2

When I enter sudo su or sudo -i in terminal on Ubuntu 12.04, I cannot become superuser. When I enter the password nothing happens. Its like:

user@host~: sudo -i
enter passwd: ******
user@host~: nothing happened

And then:

user@host~: sudo -s
root@user~: WTF?

Instead when my normal user enters sudo -s it becomes root. Wtf...?

Lucio
  • 18,843
  • 1
    Are you copy/pasting the full output? Please do so. It should be root@host and :~ instead of ~: – Lucio Dec 15 '14 at 22:54
  • And what about sudo su -? – muru Dec 15 '14 at 22:55
  • sudo -s will look at the environment for a SHELL variable before looking at the users passwd for the chosen shell. sudo -i will start at the users passwd. If a SHELL variable is declared that will probably be why. Also I am not sure if the .profile and .login will be read by sudo -s – Requist Dec 16 '14 at 19:26

1 Answers1

0

It seems you wrong default shell setup for the root user.

  • In 1st command sudo -i, you passed the login authentication but no shell run.
  • In 2nd command sudo -s, you are already passed sudo authentication which it you are only asked onces per terminal (may be it has a timeout period). However this time, it loads directly /bin/bash not shell set in the root profile.

To test this theory run:

sudo -i /bin/bash

Related: 'sudo su -' vs 'sudo -i' vs 'sudo /bin/bash' - when does it matter which is used, or does it matter at all?

user.dz
  • 48,105