Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
Does it ask this if you install netbeans with sudo, too? It should never be necessary to activate the root account to achieve something in Ubuntu. –  nem75 Oct 23 '10 at 11:18
    
just as a side note, you could use sudo -i to login to root! –  Shungun Oct 23 '10 at 15:22
1  
Related Question: askubuntu.com/questions/6676/… –  Stefano Palazzo Dec 7 '10 at 17:37

8 Answers 8

up vote 26 down vote accepted

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.

share|improve this answer
2  
Note that normally there is no good reason to set a password for root. To install Netbeans you certainly do not need to set a password for root! Just use your own password (that you would normally use for sudo). –  Jesper Apr 10 '12 at 14:23
1  
To undo this and re-disable the root account, you can run sudo passwd -dl root (source). –  Eliah Kagan Jun 25 '12 at 8:31

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.

share|improve this answer

Root account is by default disabled -- that means root has no password. Ubuntu is using sudo -- sudo allows "normal users" to run commands with superuser privilegies and and to "run" sudo they are using their own password.

More information here: https://help.ubuntu.com/community/RootSudo

share|improve this answer
2  
mnemonic: superuser do –  Stefano Palazzo Dec 7 '10 at 17:36

Use your password. If you are an administrator user, you can use your password in these password prompts. If not, you will need to log on as an administrator user to do system wide things like installing software.

share|improve this answer

Try installing Netbeans from the package repositories. It's packaged in such a way as to avoid the need for a root password.

share|improve this answer
    
There's nothing special about officially packaged software installation compared to any other administrative task, when it comes to whether or not a root password is needed. Any action can be performed as root, without there being a root password, using sudo. So other installation methods will work fine too, and also not require (nor benefit from) a root password being set. –  Eliah Kagan 9 hours ago

Please see the link below:

https://help.ubuntu.com/community/RootSudo#Re-disabling%20your%20root%20account

share|improve this answer
2  
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  hexafraction Aug 17 '12 at 12:12

By default the root account is disabled, and you won't have the password for your root account. If you need the password for your root account, then you have to create one for root:

sudo passwd root

Note:

  • Enabling the Root account is rarely necessary.
  • Almost everything you need to do as an administrator of a Ubuntu system can be done via sudo or gksudo.

You can find information for enabling the root account in RootSudo. Use it at your own risk.

share|improve this answer

Encryption for passwords was invented to protect them from viewing. You cannot just view it, but you can change it without viewing old one. The only way to view an encrypted password is to decode it. You can try, encrypted passwords are in file /etc/shadow, but you'll just waste your time.

So just change the root password like this:

sudo passwd
share|improve this answer
2  
The OP wants to know their root password, not change it. –  hexafraction Aug 17 '12 at 12:11
    
Ha ha. Are you joking? Encryption for passwords invented to protect them from viewing. You cannot just view it but you can change it without viewing old one. –  BBK Aug 27 '12 at 9:02
    
The only way to view encrypted password is to decode it. You can try, encrypted passwords in /ets/shadow file but you'll just waste your time. –  BBK Aug 27 '12 at 9:49
1  
I do understand that can't be done, so why not say so? –  hexafraction Aug 27 '12 at 11:38
    
Ok, I'll add some notes to my post. –  BBK Sep 4 '12 at 18:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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