Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I did some searches in this site, however, the password did not change. I tried:

sudo passwd

. And after entering a new password, the system stop asking me password whenever I use sudo command.

How could I change my login password and root password permanently?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Ubuntu uses sudo in its privilege elevation model, so essentially your password is used as the root password because you are in the sudoers file.

As for it not prompting you to enter it every time you "sudo" there is a period of time where it will remember the elevated authentication. Now, if this is happening all the time without you ever having to type in a password it could be(most likely) that you are somehow in a group that allows running commands as root without authentication, the wheel group etc. This can be checked by looking into /etc/group and running visudo from the # terminal and looking for your username or group in that file.

Now to change the root password in Ubuntu you need to open a terminal, type sudo -s, then su root, this will switch you over to the actual root user and from here you can then run passwd and set a root password.

///EDIT/// Here is the process for changing passwords as the root users for others.

[dan@Archimedes ~]$ su root

Password:

[root@Archimedes dan]# passwd dan

Changing password for user dan.

New password:

Retype new password:

passwd: all authentication tokens updated successfully.

[root@Archimedes dan]#

share|improve this answer
1  
Mention also sudo -k. –  ulidtko Jan 23 '11 at 4:44
    
Thanks for your reply. However, it did not work for me. I did exactly like what you said. I reboot, then log back in, then run sudo apt-get update. It prompted me to type in a password, and I have to use the old one. I think I misunderstood you somewhat. –  Chan Jan 23 '11 at 9:09
    
If you set the root password, you can try to change it by opening a terminal, then su root then run passwd YOURUSERNAME <-- this will run the passwd command against your username, this should change it. –  Dan M. Jan 23 '11 at 16:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.