2

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.

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.

3

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.

---edit---

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).

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

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?

  • 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
0

Iirc in ubuntu 10.04 I could do:

sudo /bin/sh

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