I have been working with SSH for a long time, but recently I have needed to add another user to my set up. I followed some instructions I found on the web and did the folllowing.

adduser sam
sudo nano /etc/ssh/sshd_config
     AllowUsers michael, sam
sudo reboot

I set up the user sam completely, added the allow users to the sshd configuration and rebooted. Now michael is sudoer, but the funny thing is, I can login via ssh with Sams credentials but not michaels anymore.

Any ideas?

  • By "michael is the root user", do you mean michael has user id 0, or michael has sudo permissions? – Kenny Rasschaert Dec 28 '12 at 9:50
  • Ahh yes, (I believe), he is the account that was set up with the server. – MichaelH Dec 28 '12 at 9:51

From the man sshd_config:

This keyword can be followed by a list of user name patterns, separated by spaces.

Then, your line have to be in this form:

AllowUsers michael sam
  • Under voting of answer you can see big check sign :-) But, be honest, I pretend, that list of users will be separated by coma too... – Jan Marek Dec 28 '12 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.