Skip to content


How to “create” the root account in Ubuntu (or rather, configure its password)

This post in a nutshell: sudo passwd.

Linux, and more particularly Ubuntu, have always made it a nightmare to use the root account. They want you to sudo, and never to su, and it seems that they’ll do… pretty much everything they can to reach this goal. In some previous versions, maybe 8.10 – 9.04 or something, I used to manage to “create” the root account through System → Administration → Users and Groups. That wasn’t much of an account creation though: I just need to reach the root account and set its password. And finally, there was about the same issue and solution in Fedora.

A few days ago I upgraded an old computer (Athlon 64 3500+ – 2 GiB RAM – GeForce 6600 GT – March 2005) of mine to Ubuntu 10.04. And of course I eventually came to the point where I needed to sudo stuff. Since my preferred method is to login as root once and for all (su) I tried the usual “trick” to configure the root account. The root account was nowhere to be found, so I didn’t manage to set the root password.

So I kept using sudo for a few days, then got the idea to run the password edition command (passwd) simply using sudo. And it… worked! It did allow me to set the root password. So once again for those who didn’t get it yet, the command is:
sudo passwd
It will then ask your current password, then the new password and its confirmation, like:
postal@bernard-athlon-ubuntu:~/Desktop$ sudo passwd
[sudo] password for postal:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

The only requirement there is that your user account must be in the sudoers list. On a standard Ubuntu installation, this is the case (it should be the case on Fedora too).

Posted in Linux.


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Y J Morabiya says

    i donot know how to create root account in ubuntu 11.04, i given command in terminal
    sudo -i



Some HTML is OK

or, reply to this post via trackback.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA