4

I accidentally modified the line for root in /etc/passwd and changed its named. To fix it I tried using sudo to modify this file, but it does not let me sudo because sudo can't find the root user since I renamed it.

II am on ubuntu.

1 Answer 1

6

Try :

sudo -u new_wrong_root_user

If you can't, reboot on a live-cd, then in terminal :

mkdir target
mount /dev/sda1 target # sda1 if / is the first partition of the first drive
vim target/etc/passwd
1
  • sudo -u worked.
    – aafc
    Dec 11, 2012 at 21:15

You must log in to answer this question.

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