How-To Enable and Disable root User Login in Ubuntu
Archived from my original blog (2010). Some details may be out of date.
Ubuntu comes standard with a security feature that requests you to create a user during installation. This is the only user that can log into the machine after installation, and the default root user is not enabled.
Sometimes it just gets irritating to have to type “sudo” in front of every command you want to issue, it sort of makes Linux feel like Windows Vista that asks you for permission for every little thing!
Other times you just want to be the boss, no holds barred!
While this limitation is a good security feature, you might have certain scenarios where you would just like to be able to do the good old root-login.
There are two ways to get around this.
Session Based
To be “root” for just your current session, until you log-out again, just type:
sudo -i
Once you log out of your current session, you will revert back to your normal access level.
Permanent Fix
To re-enable the root-login, just type:
sudo passwd root
And then type the new password for the root user when asked.
Reverse Permanent Fix
When you’ve completed your tasks that required root-login, you can disable the root login again by locking the account with the command:
sudo passwd -l root
Obviously you need to be logged in with your original non-root user to successfully do this.
Posted in Linux Solutions by NielM 1 Comment
Niël Malan
The Practical Futurist