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 am trying to change the root password in my Ubuntu system but I am getting an error. I disabled password prompt when calling sudo. So I can execute root commands (eg. sudo apt-get install) without typing root password.

ashot@ashot-desktop:~$ sudo passwd root
passwd: Authentication token manipulation error
passwd: password unchanged
share|improve this question

migrated from stackoverflow.com May 13 '13 at 18:49

This question came from our site for professional and enthusiast programmers.

    
Have you tried just sudo passwd ? –  Ex Umbris May 13 '13 at 18:24
    
Yes, the same error –  Ashot May 13 '13 at 18:25
    
What about sudo -s -H (to launch a sub-shell as root) followed by passwd? –  Ex Umbris May 13 '13 at 18:27
1  
Is the root filesystem r/o? –  Ex Umbris May 13 '13 at 18:32
1  
sudo su - to obtain a root shell and change the password there –  dawud May 13 '13 at 19:09

2 Answers 2

The root account is locked by default in Ubuntu. When sudo asks for a password, you give it your user's password, not root's. This works because your user is in the sudo group and therefore has permission to run commands as root. If what you want is to reset your password, just run

passwd

If you have enabled the root account in Ubuntu and want to change that password, boot into recovery mode, log into a "root shell prompt" and reset there.

  1. Remount the / filesystem read/write

    mount -o rw,remount /
    
  2. Reset the password

    passwd
    
share|improve this answer

As one of the comments on your question suggested, there is a quite high probability that your root filesystem, "/" might be mounted read-only.

Try this command to see if it is the case:

sudo touch /testfile

if you get something like "can not create" or alike, you might want to try this command:

sudo mount -o rw,remount /

I have had reasonably high percentage of success, but sometimes it just doesn't fix the situation, forcing you to reboot. Trying it is easier than a reboot for sure.

share|improve this answer

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.