Ubuntu: How to enable the root account
Ubuntu is one of the few Linux distributions out there that will not enable the root account (actually it is the only one I have seen myself, but hey, there might be others that I am not aware of). This is a very good idea and you should probably try to learn to use sudo for daily maintenance. But in case you want to enable root login on your Ubuntu system this little post will show you how you can do that.
As you have noticed during the Ubuntu installation there was no question about the root password, as you might have been used to see during other Linux distribution installation process. This is why the root account is inactive and can’t be used (no password configured) until we will setup a proper password for it. To do this, we simply need to run:
sudo passwd root
This will ask for a new root password and once you confirm it, you can start using the root account to login.
In case you will want to disable back the root account, just lock the root account by running:
sudo passwd -l root
Are you aware of any other Linux distribution that doesn’t enable the root account at installation time? I am just curious because I believe that this is a great idea… but I haven’t seen it implemented in other distributions.
Share This








12th November 2006, 10:46
Be aware of locking the root account if you once activated it. I activated the root account and skipped the %admin ALL=(ALL) ALL line int /etc/sudoers file because i thought i wouldn’t need it anymore. Then i disabled the root account without thinking and now had no chance to start programs with root rights. Luckily i could restore it using a knoppix live cd. Be aware of changing settings concerning the root account.
31st December 2006, 20:50
Another system is Mac OS 10 (not really linux but based on bsd). It uses the root account mostly to install software - unless you want to do some command line sudos.
Same trick works there too:
sudo passwd root
7th January 2007, 15:54
If I need to perform a lot of maintenance as root, I simply use “sudo su -” to launch a root shell. I do also set a root password, just in case the /usr partition gets corrupted (so sudo won’t work!)
28th February 2007, 15:07
God Bless Open Source
31st August 2007, 20:36
Very nice post, thanks. The info is really useful.
26th January 2008, 10:45
This is a very old feature of ‘Debian Linux’. As ‘Ubuntu’ is based on it, it uses the same feature. It is actually a very good feature if you want to just set the system as a linux box & not have anyone play with it. Use it as it is for some basic purposes. Prevents you from harming the system. You can still do all your software installations but with the assurance of not messing up the system.
27th May 2008, 04:31
[...] Christof Baumann mentions in this post as to why you shouldn’t fiddle with the root account: Be aware of locking the root [...]
20th September 2008, 07:32
can i login using the root account at the first login window by entering the root password?