Possible Duplicate:
How to know my root password?
I'd like to define a password for root so that I can use su directly, without having to prepend it with sudo. And because I'd like to log in as root as well.
So how to set a password for the root user?
73 Answers
Warning: Directly logging in as root is like playing with fire, because one little typo is enough to lose critical data or make your system unbootable. Note that desktop environments will also function incorrectly if you login to them as root.
See these questions for the reasons behind why
sudois preferred and why root-login is disabled by default:
You may have noticed that you can’t log in as root on Ubuntu, this is because root doesn’t actually have a password set.
Enter the following command:
sudo passwdYou will be prompted for your current user's password, followed by the password you want to set for root. The messages prompted should be similar to the following:
[sudo] password for <username>: <Type your user password and press return>
Type new UNIX password: <Type the root password you want>
Retype new UNIX password: <Retype the root password you chose in the previous prompt>The following message will appear after that:
passwd: password updated successfullyIf the above message showed up on your terminal, you can now enter as root from your current user entering the following command:
suAnd you will be prompted for the root password you've set. That's it!
1If you still want to use su after reading the warnings in the question, there is no need to set a root password. Just do sudo su and you're on your way with your regular password.
What I do to create the root on ubuntu: first I do this
sudo -ithen
passwdas @Zignd mentioned the classical messages will appear:
Type new UNIX password: [Type the root password you want]
Retype new UNIX password: [Retype the root password you chosen before]
passwd: password updated successfullythen I can use the su as a normal root acount...