Pages

Thursday, November 22, 2007

Recover root privileges in Ubuntu 7.04

While trying to change username of admin user who is listed in suderos. I edited /etc/passwd of that particular user of my machine. Afterwards found that not able to do any administrative tasks as I changed user anilkumar to leo and leo was not in suderos group.

To gain back admin privileges
-------------------------------
step 1 # rebooted system with ubuntu live CD

step 2 # mounted root file system

ubuntu@ubuntu$ sudo -s

ubuntu@ubuntu$ mount -t ext3 /dev/sda2 /home/ubuntu (to find device use "fdisk" )

ubuntu@ubuntu$ vi /etc/passwd

step 3 # reboot


We can also edit grup i.e /boot/grub/menu.list (if it got crashed ).

No comments: