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 have Linux Virtual machine (ubuntu 12.04) installed on my Mac OS.

On my terminal,

user@192.78.0.1:~$ su
password:
su : Authentication failure

user@192.78.0.1:~$ ls -lth /bin/su
-rwsr-sr-x 1 root root 36K Sep 12 2012 /bin/su

But the following works:

user@192.78.0.1:~$ sudo ls
[sudo] password for user:
(....lists the directories)

 user@192.78.0.1:~$ sudo -s
 [sudo] password for user:
 root@192.78.0.1:~#

Hence the question is, why sudo -s works and logs in as root, while su results in authentication failure. I typed the passwords correctly each time. Also sudo ls works

share|improve this question
    
possible duplicate of su command + authentication failure –  Eliah Kagan Aug 8 at 23:29

3 Answers 3

up vote 1 down vote accepted

In Ubuntu by default, the root user has a disabled password and the mechanism available for general users to use root permissions is sudo. su with no arguments attempts to change the current user to root, and since it is disabled....

share|improve this answer
    
well it prompts for password su and when I type in the correct password, it gives authentication failure –  brain storm Aug 8 at 21:55
    
Exactly. "su" will still prompt for a password, but since the root account is disabled, you get authentication failure. "sudo" depends upon your username having sudo permissions. –  Charles Green Aug 8 at 21:58
    
but I have seen where su and followed by password works. If this feature is possible, how to enable it? or how to undo the disable of root account? –  brain storm Aug 8 at 22:00
    
@brainstorm: see this question. –  saiarcot895 Aug 8 at 22:39

try using

    sudo passwd root

to change password for your su user. See if that helps. Then retry using su and entering the password you have have have just assinged.

share|improve this answer

I think you can do what you are looking for using:

sudo su

This works for me on Ubuntu 14.04. Although in general you should be careful about doing this for security reasons.

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.