0

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

2 Answers 2

1

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
    
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .