1

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

brain storm
  • 267
  • 1
  • 3
  • 8

4 Answers4

2

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

Charles Green
  • 21,339
2

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.

TheSchwa
  • 3,820
1

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.

Vyras
  • 21
0
sudo -i

gives a root prompt,

passwd 

changes the root password, from that point you can login as usual.

Jens Erat
  • 5,051
  • 7
  • 31
  • 37