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 installed Ubuntu 12.04 LTS (Precise Pangolin), 64 bit. Nowhere was I asked to set password for root.

I just installed AccuRev SCM software. It was installed under the /root folder by default. Now I try do something on that folder. I tried with su to switch to root, but I don't know its password.

Should I always use sudo or get the default root password, if any?

How do I create a launcher for software installed inside the /root directory?

share|improve this question
1  
See this: Ubuntu Community Help Wiki: RootSudo –  gertvdijk Sep 17 '12 at 19:14
    
From RootSudo: "the Root account password is locked in Ubuntu. ... you cannot login as Root directly or use the su command to become the Root user ... This is where sudo comes in ... When using sudo, your password is stored by default for 15 minutes. After that time, you will need to enter your password again. " –  Peter Mortensen Jun 1 '13 at 8:46
    
this lameass website won't let me answer, but the correct answer is: sudo usermod root -p password; sudo passwd root; then enter the new password. presto, root is unlocked and you can now su/login with root –  r3wt Jun 7 at 17:03
add comment

4 Answers 4

up vote 10 down vote accepted

By default, the root account is accessed by sudo.

For a complete discussion in the topic, and information for how to set a root password, see: RootSudo - Community Ubuntu Documentation

With that said, it is extremely unlikely you need to set a root password, I advise you use

sudo -i

Or for graphical applications, use gksu

gksu nautilus 
share|improve this answer
add comment

I don't know what is the default password. but in case if you want to change the root password to your own then go through following commands

sudo passwd

after this you will be asked for new password twice(new and retype password) and finally that is your new root password.

share|improve this answer
add comment

By default Ubuntu does not set up a root password and therefore you don't get the ability to log in as root. Instead you are given the ability to perform tasks with superuser privileges using sudo.

I've answered a similar question before.

While you can create a password for the root account allowing you to log in as root with su, this isn't the typical "Ubuntu" way of doing things. Instead Ubuntu expects that you will be using sudo.

Sudo is an alternative to giving people a root password in order to perform superuser duties. In a default Ubuntu install the person who installed the OS is given "sudo" permission by default.

Anybody with "sudo" permission may perform something "as a superuser" by pre-pending sudo to their command. For instance, to run apt-get dist-upgrade as a superuser, you could use:

sudo apt-get dist-upgrade

You will see this usage of sudo pretty much anywhere you read a tutorial about Ubuntu on the web. It's an alternative to doing this.

su
apt-get dist-upgrade
exit

With sudo, you choose in advance which users have sudo access. There is no need for them to remember a root password, as they use their own password. If you have multiple users, you can revoke one's superuser access just by removing their sudo permission, without needing to change the root password and notify everyone of a new password. You can even choose which commands a user is allowed to perform using sudo and which commands are forbidden for that user. And lastly, if there is a security breach it can in some cases leave a better audit trail showing which user account was compromised.

Sudo makes it easier to perform a single command with superuser privileges. With su, you permanently drop to a superuser shell which must be exited using exit or logout. This can lead to people staying in the superuser shell for longer than necessary just because it's more convenient than logging out and in again later.

With sudo, you still have the option of opening a permanent (interactive) superuser shell with the command:

sudo su

... and this can still be done without any root password, because sudo gives superuser privileges to the su command.

And similarly, instead of su - for a login shell you can use sudo su - or even sudo -i.

However when doing so you just need to be aware that you are acting as a superuser for every command. It's a good security principle not to stay as a superuser for longer than necessary, just to lessen the possibility of accidentally causing some damage to the system (without it, you can only damage files your user owns).

Just to clarify, you can, if you choose, give the root user a password allowing logins as root, if you specifically want to do things this way instead. I just wanted to let you know about the Ubuntu convention of preferring sudo instead and let you know that there is an alternative.

share|improve this answer
add comment

You can type

sudo bash

or

sudo -s
share|improve this answer
2  
Please provide more information/explanation in an answer. –  maxf130 Jul 26 '13 at 12:57
    
or type sudo su –  mchid 2 days ago
add comment

protected by Community May 4 at 9:28

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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