I recently set up a new CentOS 5 server, which has OpenSSH installed by default.

When I connect with PuTTY, the SSH server tells me "access denied" before prompting me for a password. Once I provide the password I log in to my shell fine. It never used to work seemingly out of order like that before, and there's nothing strange in the security log when I log in, just a successful login.

login as: admin
Access denied
admin@gold's password:
Last login: Sun Jul 17 00:26:50 2011 from pool-xxx-xx-xxx-xx.phlapa.fios.verizon.net

I made one change in the default config to change PermitRootLogin to no.

I also upgraded PuTTY to the latest version on the same day as setting up the server, though that's probably unrelated.

  • look at/post the output of ssh -v your-server and tail -f /var/log/secure
    – Lmwangi
    Jul 17 '11 at 5:29

Uncheck "Attempt GSSAPI authentication (SSH-2 only)" under SSH -> Auth -> GSSAPI.

  • Bingo. This was exactly my issue. Is this just a CentOS build that prints that message? Or is it something else? Aug 14 '12 at 7:13
  • It seems that problem is in GSSAPIAuthentication option set to yes in /etc/ssh/sshd_config in RedHat-like distributives (CentOS, Scientific Linux, etc.). Aug 14 '12 at 11:55
  • Yep, just noticed that difference to my Debian box. Good call! Aug 14 '12 at 15:53

Is it possible that it's trying some other authentication method, such as public-key, before falling back to password? I'm wondering if maybe your permissions on ~/.ssh/ (and the usual files inside there) are wrong on either the client or the server end. Maybe it's saying "access denied" because it wasn't allowed to read your id_rsa.pub on the server side, or your id_rsa on the client side.


In putty UNCHECK Attempt Auth Using Pageant in your connection.


I bet on a PAM module. Which modules are in the ssh auth chain?

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.