1

I am working on an ubuntu 12.04 server and i was not provided a sudo password. Now i need to recover it. I found out that we need to reboot into recovery mode to do so but we don't know how to get into recovery mode through ssh.

Any idea of how is this possible or any other ideas for recovering the sudo password? I have root access through ssh.

Update:

I've tried to do this:

su -

But without success:

su: Authentication failure
19
  • 4
    I have root access through ssh. - So what is it you need again? If you actually have root access, then you have all you need. Remember the sudo password, is the password for the user issuing the sudo command. Just run passwd username to set the password for your users.
    – Zoredache
    Oct 1, 2014 at 17:51
  • passwd username returns Authentication token manipulation error
    – Toon
    Oct 1, 2014 at 17:55
  • 2
    It seems likely that you have done something with an external authentication source, and broken it. Do you have ldap authentication setup or anything? Or maybe you have broken PAM in some obscure and unusual way.
    – Zoredache
    Oct 1, 2014 at 17:56
  • No other errors beside that one?
    – miniBill
    Oct 1, 2014 at 17:58
  • See if sudo -i works. Oct 1, 2014 at 18:09

2 Answers 2

1

You cannot change your password due to the filesystem being mounted in read-only mode when booted into Ubuntu's recovery system.

See this AskUbuntu answer for more detail, but you will need to run the following command to re-mount the filesystem as read/write:

mount -rw -o remount /

After remounting, the output of the mount command should look similar to this for the root filesystem:

/dev/sda1 on / type ext4 (rw,errors=remount-ro)

As an aside, running su - as root will not give you any higher access - root is the highest possible on a Linux system.

0

Do you have sudo access from your user account? SSH to the box, login and type

sudo -i

If you can get in, you are now there as root using your credentials. You can then change the password. Give that a try?

You must log in to answer this question.

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