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.
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.
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
0
If @sputnick's answer does not work, another solution would be to boot a live disc and mounting your drive in that, then use the live root user to adjust it.
sputnick does mention that possibility (perhaps a grace period edit), so this answer doesn't really make a lot of sense... – a CVn – 2014-10-17T08:32:34.223
sudo -u worked. – aafc – 2012-12-11T21:15:49.713