How to find out root password for installing software

As default Ubuntu has no password set for the root user, i.e., the account named root. To gain root privileges as another user you have to type in your own password. This is the password you set for the first user account while installing Ubuntu.

To set a password for the root, run the following command in a Terminal shell:

sudo passwd root

After this you are asked to type in the new password twice. After this the root account has its own password, so you can actually log in with the user name root.


The root password on Ubuntu systems is left unset and unusable on purpose. Ubuntu uses sudo (switch user do) to elevate the privileges of an administrative user. (The user created on installation is, by default, an administrative user.). Sudo logs everything passed to it, which is useful, as you can check later what commands have been run with it.

If you're being prompted for any password, it's most likely your own (user) password that's needed.

  • Why is it bad to login as root?
  • Why is there no option to login as root?