Restoring root privilages to user

I have a bunch of files and scripts that I wanted to use and they were written for a different user name then the one that I use, so I figured that i would merely change the name of my user.

I thought the best way to do so would be create a new user with a different name, give that new account elevated privileges, log-in to new account, from new account type usermod -l newname oldname of account I want to rename. I figured this was best way since I was unable to change the name of the account while logged into that account.

When I restarted and tried to log into the newly created account I was unable because I don't have a password, I assumed the password would of been the same as the original account since there was no prompt asking for a password for the new account.

After that I tried to do some other work around. I Opened Dolphin, navigated to /etc/sudoer.d and played with Ownership to..., change permission and the other options. In doing to I changed the permission the the original account had and now that account does not have root privileges.

How do I restore root to the original account, and how do I change the name of that account so that it will match the file paths of the files and scripts I'd like to use?

First of all, that is quite a convoluted workaround, when all you really needed to do was chown the file. Second, look at which groups your user is part of and if it is not in wheel, add it, to give it sudo privileges. I don't know what exactly you changed in /etc/sudoers.d but with default Garuda settings, that should work.

2 Likes

Thanks, I will research on how to do that. I am not a Linux expert and do most of this stuff by trial and error, mostly error!

this is my output:

image

Just change your scripts with sed Petra or what ever to $USER.

That’s ok, that’s how we learn :slightly_smiling_face:
You should log in as root and change the ownership of /etc/sudoers.d back to root, based on that screenshots. Note that we do prefer terminal output in plain text for the future.

3 Likes

Hahaha, yes now I realize that this would of been the "easier" thing to do, but there are a lot of them and I figured I'd save myself a day of changing things around by merely changing the user name. Now that I have really messed things up I think that is what I am going to do, but I still want to restore root privileges to the original user. If I could somehow log in to the other account I could change permissions back for the original user.

How to log in as root?

su

You were asked in installation whether to set a separate password or use the same one as first user.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.