CentOS 5.3. I can SSH into the system as root just fine. Added a user and set their password. They have shell access (/bin/bash). I can su to the account from root just fine. I updated /etc/ssh/sshd_config with:

AllowUsers myNewUser

And restarted sshd: /etc/init.d/sshd restart

When trying to ssh into the server with the new user, I get a permission denied. And yes, I've double and triple checked that I am using the correct password. Any help is appreciated.

  • If you turn on verbose logging you'll probably be able to tell quite quickly what the problem is. Jun 5, 2010 at 2:15
  • 1
    look at /var/log/secure and /var/log/messages for ways to debug and post that info here
    – Mike
    Jun 5, 2010 at 4:12
  • su <newuser> is different from su - <newuser>. Did you try the latter, which starts a login shell?
    – mpez0
    Jul 17, 2010 at 14:18

2 Answers 2


Is the uid >= 500? On RHEL/CentOS, the default PAM config has a check for uid. Another possibility could be the password is expired (if you set it as root using passwd <username>) - does a login rather than su to the user reveal any issues there? Does it work using Pubkey authentication rather than a password?

The reason is probably logged in authlog, and troubleshooting without that log data is really just speculation.


Can you change the Log level in your sshd_config to look like this:

LogLevel DEBUG

Restart SSH. Then try logging in as myNewUser and post the output from /var/log/secure here (after stripping out any specific identifying information!) 1

1: The DEBUG log level can violate User privacy according to the man-page for sshd(5)

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.