Score:0

Root password change reverted after reboot

in flag

I've just installed a new ubuntu server. It is a virtual machine hosted on Hyper-V. I'm trying to change the root password using the following commands:

sudo passwd

and then entering the new password.

Everything look fine until I reboot the server. Then only the old password works.

Could you please advise how to resolve this?

Thank you

David avatar
cn flag
Try sudo passwd root If you never got a confirm message you never changed it in the first place.
in flag
Hello David, I received the message: passwd: password updated successfully but when I rebooted the server, still the same issue.
David avatar
cn flag
You also should have said in the question what you had tried and I would not have told you to do something you had already done.
Score:3
cn flag
sudo passwd

changes the admin password (that is the user used to create the system with) not the password for root. Anything related to root does not require sudo and will mess things up (as Ubuntu expects you meant the admin user when using sudo).

change the root password.

You change to root using

sudo -i

(requires the admin password) and then change the password for root with:

password

Mind that Ubuntu is not meant to be used with root. If you want that it is better to change to a system that does use that out of the box. Using root on Ubuntu can have unwanted side effects. sudo is a slight improvement over using root when it comes to security: hackers need your admin account name and the password. Using root means the former is known to all.

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.