Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Is there a root password on OS X and Ubuntu?

After I installed Ubuntu, I noticed that I'm not sure what was superuser password set, If I set it at all. I know that I created a user via which I'm logging in. But when I write su command the password for the user I created does not work.

Does it mean that superuser is the one user I created and I can use sudo xralf to gain superuser privileges? Is there some material on this topic. I'm still little confused how this works in Linux.

share|improve this question

marked as duplicate by Michael Mrozek Dec 5 '11 at 15:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 3 down vote accepted

In a regular Ubuntu install, you never explicitly set the root user password. You can still however su to root easily by typing sudo su - in a console when logged in as the first regular user you created (which has sudo privileges).

I presume that the password is set to something random and unknown to any human, for security reasons, although this always seemed a bit strange as compared to other distros where you do set a password for root before even creating any other users.


As per Kevin's answer, the password is not random as I had suspected, but initially disabled (follow the link in his answer for further details).

share|improve this answer
Not random, as I mentioned it's disabled entirely. – Kevin Dec 5 '11 at 15:50
you can if you like enable the root account with sudo passwd – squarebear Dec 5 '11 at 16:13
@Kevin edited answer to aknowledge this – Dalker Dec 5 '11 at 16:18

On a default Ubuntu install, the root account is locked, which is implemented by storing into the password hash field a value that cannot be a legal hash. See more details here: Is there a root password on OS X and Ubuntu?

share|improve this answer
You can flag a question to be closed as a duplicate when this happens. "flag -> it doesn't belong here (which makes no sense in this case, but oh well) -> exact duplicate" – Michael Mrozek Dec 5 '11 at 15:39

Iirc in ubuntu 10.04 I could do:

sudo /bin/sh
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.