Ubuntu – How to find out root password for installing software


I'm trying to install the NetBeans IDE in my Ubuntu and in the process it's asking for my root password which I don't remember. I know my sudo user password. How can I recover my root password?

Best Answer

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

  • Related Question