su command + authentication failure

105,558

Solution 1

su asks for the root password. Since Ubuntu doesn't set a root password by default, you can't use it to become root.

Instead, to become root, use sudo -i with your personal password.

Solution 2

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

Solution 3

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

Solution 4

when you need to login as one of your non-login userids say git ( has no pwd)

su - git
Password: 
su: Authentication failure

SOLUTION - use this syntax to login as userid git

sudo su - git

Solution 5

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:
105,558
user12895
Author by

user12895

Updated on September 18, 2022

Comments

  • user12895
    user12895 over 1 year

    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??

  • Jerry Asher
    Jerry Asher about 13 years
    I admit I tend to use sudo bash but your incantation makes me want to use su sudo or maybe su su sudo.
  • guntbert
    guntbert about 10 years
    sudo su is not the recommended way - use sudo -i instead.
  • vijay
    vijay almost 5 years
    Try youtube.com/watch?v=axDObUgsuZQ instead, it will help you to solve the authentication failure error on su root