Ubuntu Linux Restore admin / root level permissions
I was writing and testing few python scripts (yes I'm moving lot of stuff from shell / perl to python these days) and accidentally I renamed my own user account from vivek to test. However, I did not noticed change until I rebooted my box. Now I cannot run sudo (or become a root user) and cannot access special devices such as sound or video.
By default your first account has all power via sudo under Ubuntu Linux. There is a special group called adm and admin which grants unlimited power via sudo.
The only solution was to boot computer in emergency mode (reboot computer and at grub menu select recovery mode kernel), open /etc/group file and add user vivek to admin and adm group:
# vi /etc/group
Add user vivek to admin and adm group:
admin:x:117:vivek
adm:x:4:vivek
Save and close the file.
Now I'm able to run sudo and do other stuff. Luckily, my scripts always backup critical files before modification. So I was able to restore permission instantly. Here is my group membership with all power and glory ![]()
$ id
$ groups
Output:
vivek adm dialout cdrom floppy audio dip video plugdev scanner netdev lpadmin powerdev admin
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in...
- Debian Linux: Allow non-root user to write CDs
- What is umask and how to setup default umask under Linux?
- Solaris adding group
- Understanding Unix and Linux permissions
- Unix or Linux commands for changing user rights
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: critical files, group admin, group membership, groups_command, grub, id_command, recovery mode booting, root user, special group, unlimited power ~ Last updated on: November 1, 2007



[...] Ubuntu Linux Restore admin / root level permissions [...]