Change password for root

Hello everyone!

I am a frequent visitor here for the past 3 years, but never really posted here. The community is very helpful, saved me a couple of times :grin:

The issue:

Recently I had too reinstall my Manjaro because of a dual boot issue. During the installation process, I chose a very simple root password and now I would like to change it.

I found a post here that suggested this:

sudo su
whoami       # make sure you are root
passwd

Following this suggestion, I changed the password successfully. The problem was that after I rebooted the system the change has been undone.

How can I change my root password for good?
Thanks

Hello,

Since your user is admin, then you run:
sudo passwd root
It will ask your password and then to set the new password for root.

2 Likes

I would be very careful what you run.

Thank you for your response.

I might have been misunderstood.

My user is not root. I cannot execute any super user commands without using sudo .

I tried your command and it changed the password only temporarily. After rebooting the password was changed back to the old one.

Thanks

As I replied to bogdancovaciu, I am not the root user.

Thanks for your concern though

Do you think i’m confused?

Are you running a live system ?

After all, if I understand correctly, would you like to change the password for a normal user?

I thought I didn’t explain myself well, of course I didn’t think you’re confused.

I am not running a live system.

No.
I am the only user on the system. For example, in order to run sudo pacman -Sy , I need to type the root password.

No! You need to provide YOUR password.
root can have the same password as yours, if you set that during the install, or a different one. Either way you can assign a new password to root with the command i provided.

In a terminal, you type sudo su, which asks for your old password. Then, after the root prompt, you need to issue the passwd command, which asks for the new root password twice. This should be a different password than yours. That’s all.

I guess it was a simple mistake of mine eventually :sweat_smile:
It worked out now.
Thanks mate, for your patience

1 Like

No worries. Was a honest “mistake” because of the message pacman prints out if run not as administrator. This days most such administrative commands move towards polkit. For isntance if you run pamac update will ask you to introduce your password in a very explicit way. If you run sudo pamac update the message to introduce your password is not so “fancy”.
Glad you sort it out tho. :slight_smile:

1 Like