Score:1

How to add an Ubuntu user that is administrator and that has sudo access?

cn flag

I've installed Ubuntu and enabled the home folder encryption, I was working on it and everything was right, but I've changed my password recently and forgot the old one, so I got the home folder unmounted. I know it's complicated till I can find where I stored my passphrase to mount the home folder again.

So my question now is that I want to add a new user that has the same privileges as my own that can have access to everything and change everything and install all the updates. I have the new password to create a user but I'm not sure how to make it as a master administrator. and can I do that on user management GUI without terminal like we usually add users ?

Torge Rosendahl avatar
in flag
Are you able to log in through the GUI?
waltinator avatar
it flag
Read `man adduser sudoers`.
ar flag
You can reset your password search this site.
ar flag
Does this answer your question? [How do I reset a lost password (using recovery mode requires me to type the password)?](https://askubuntu.com/questions/121698/how-do-i-reset-a-lost-password-using-recovery-mode-requires-me-to-type-the-pass)
Kaylee avatar
cn flag
@TorgeRosendahl ! Yes I can log in through the GUI
Kaylee avatar
cn flag
@user68186 ! it doesn't solve my issue because I didn't lost my password, I've changed it, I know the new one that I can log in with but I forgot the last one. and it's an administrative user but that's all I can do is to log in I can't access my files and can't make any change because the home folder is encrypted .
Score:2
cn flag

I am afraid the encryption will complicate matters here. Encryption involves that the password is also involved in creating the encryption keys. That means that that specific password, and only that, is required to decrypt the partition. Resetting the login password will not change that.

So if you have lost the password, consider the encrypted partition lost.

That with respect to problem X, decrypting the partition after the password is lost.

With respect to the problem you ask about (Problem Y, creating a new user with root privileges hoping that will allow to decrypt the partition): you only can use the user management GUI if you can log in to an account that has sudo privileges. Else, you need to use terminal tools from a command line where you can access root privileges. That can be a user account with root privileges, or a recovery prompt with root privileges.

Sorry for the harsh post, but the important take home message is that you have to be very careful with passwords when working with encryption. What you are now experiencing, is one of the factors why encryption indeed is pretty safe.

Kaylee avatar
cn flag
Thank you for your answer @Vanadium . well I understand that we should be careful dealing with encryption so I still have the 32 characters passphrase used for encryption . I stored it in another computer but can't remember exactly where cause that was in 2017. when I installed Ubuntu 16.04 . but the problem is that Passphrase is like never used , we can decrypt the home folder using the login password and since I changed it , I can't decrypt it now. what's strange is I can log in through the graphical interface but can't change anything , and I did created a user that is administrator
Kaylee avatar
cn flag
so the user I just added is administrator and has sudo privileges but I still feel I can't have a full control of everything since I don't see the softwares I've installed but though I can see an antivirus ... isn't that strange ? also why we can't decrypt using the passphrase that was generated during the encryption ? why we only can decrypt with the password. anyway, for now I only want to make sure if that administrator that I just added is limited as it seems to me or has the same privileges as my old one ? and if not how to get all the privileges ?
vanadium avatar
cn flag
So your encrypted home has been created in Ubuntu 16.04? That is important information, because that way of only encrypting folders is not anymore shipped with Ubuntu. Ubuntu now only provides partition level encryption, so it could have been you had a separate home partition that was encrypted.
Kaylee avatar
cn flag
Yes I checked that box enabling the encryption during the installation of Ubuntu 16.04. and later upgraded to the next LTS ... so now I'm using Ubuntu 22.4 . it's actually better and safer to encrypt the whole partition. so is that means the user I just added has as much privileges as my last one ?
vanadium avatar
cn flag
Any user with root permissions has the same priviledges, i.e., change any system component. An encrypted volume, though, requires a unique password, so even the most skilled administrator will not gain access without the password. That is the message I was trying to convey in my answer.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.