Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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

share|improve this answer
    
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 0:04

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.