1

Bit of an odd problem. I've got a server I can SSH into as one of two logins: root or erik. Once I've logged in as erik I've tried to switch to the root user:

# sudo su - root
Password:

And entered the password. After several failures I thought I might have forgotten. So I SSH'd in as root, and changed the root password:

# passwd

Now back to the other shell (erik) and attempt to run sudo su - root and again, it won't accept the just changed password. Any ideas?

erik
  • 89
  • 1
  • 1
  • 2

1 Answers1

4

"sudo su" is redundant. Use just "su - root".

When using sudo if the user (erik) is in the sudoers group (usually "sudo" or "wheel") then you are expected to provide erik's password at the password prompt and then "su - root" is run as root so it will just spawn another instance of the shell without asking for password.

On the other hand if you run just "su - root", then you will be prompted for root's password.

MasterM
  • 1,061
  • 2
  • 11
  • 18
  • thanks; apparently my user is not in the sudoers file – erik Jun 24 '12 at 23:41
  • @erik if this answered your question, click the check mark to the left of the question to accept it as the correct answer. It helps to quickly show future visitors what the answer is as well as keeping this question from floating to the top page periodically. It might be worthwhile to read the [faq], this site is quite a bit different than a forum. – MDMarra Jun 25 '12 at 00:04