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 am having problems with the su command. I know my password and I am typing it correctly but su indicates authentication failure.

So I checked on the internet and then went into recovery mode and changed my username's password to what I was entering before.

Even now entering the same password on su gives me authentication failure.

Please suggest what am I doing wrong??

share|improve this question

5 Answers 5

up vote 16 down vote accepted

su asks for the root password. Since ubuntu doesn't use a root account, you normally do not have this password set.

To become root use sudo su with your personal password.

share|improve this answer
2  
I admit I tend to use sudo bash but your incantation makes me want to use su sudo or maybe su su sudo. –  Jerry Apr 10 '11 at 9:42
    
Interesting, thank you. –  Jerry Apr 10 '11 at 17:49
    
sudo su is not the recommended way - use sudo -i instead. –  guntbert Mar 2 at 21:30

su asks for the password of the account you're trying to login. It's usage (simplified):

su username

When omitting username, the username default to root. Since the root password is disabled by default on Ubuntu, no password will be valid. The preferred way to run root commands is not through a su shell, but with sudo as in:

sudo mount /dev/sdb1 /mnt
share|improve this answer

The root account in Ubuntu is disabled by default. This is to say that it has no password (which is different from it having a blank password) and no attempt to authenticate with root's password will succeed. Therefore, su or su - will not work.

Instead, use sudo to run a command as root:

sudo command...

If you want a root shell like you get with su, run:

sudo -s

If you want a root shell like you get with su -, run:

sudo -i
share|improve this answer

su asks for the root password.

You can set a root password while you're root (by giving sudo su, providing that you are on the sudoers file), by giving the command passwd and setting a new password.

This is not recommend it for various reasons, though.

share|improve this answer

In Ubuntu root account is disabled by default. In order to perform root action you can do one of the following

  1. Use sudo with your user password, and you can do everything that root user do.
  2. Use sudo su with your user password to obtain root access
  3. Use sudo passwd with that command are changing the root password, then you can easily access root user using su like other distros (and you can continue to use also sudo).
share|improve this answer

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.