Saturday, December 13, 2008

Adding a root user without root access (Ubuntu)

If you are trying to run a root command and your username is not in the sudo list (i.e. getting a message like " is not in sudoers file ubuntu" when running 'sudo '), then add yourself to the sudoers file.

1. Reboot the machine and enter the recovery mode (press ESC a few times during the startup and select Recovery Mode)
2. Execute 'visudo'. Copy the line containing 'root ...' from sudoers file replacing root with your username.
3. Save the file and root. Your username now should be allowed to run sudo command.

No comments: