I'm trying to login to my ssh server using a username and password, but I get this error after entering the correct password:
Permission denied, please try again.
I can login using a pubkey on another machine, though, but I have NOT disabled regular password authentication. The only thing I disabled was root logins.
Here's my sshd_config file:
# Package generated configuration file # See the sshd_config(5) manpage for details # What ports, IPs and protocols we listen for Port 22 # Use these options to restrict which interfaces/protocols sshd will bind to #ListenAddress :: #ListenAddress 0.0.0.0 Protocol 2 # HostKeys for protocol version 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key #Privilege Separation is turned on for security UsePrivilegeSeparation yes # Lifetime and size of ephemeral version 1 server key KeyRegenerationInterval 3600 ServerKeyBits 768 # Logging SyslogFacility AUTH LogLevel INFO # Authentication: LoginGraceTime 120 PermitRootLogin no StrictModes yes RSAAuthentication yes PubkeyAuthentication yes #AuthorizedKeysFile %h/.ssh/authorized_keys # Don't read the user's ~/.rhosts and ~/.shosts files IgnoreRhosts yes # For this to work you will also need host keys in /etc/ssh_known_hosts RhostsRSAAuthentication no # similar for protocol version 2 HostbasedAuthentication no # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication #IgnoreUserKnownHosts yes # To enable empty passwords, change to yes (NOT RECOMMENDED) PermitEmptyPasswords no # Change to yes to enable challenge-response passwords (beware issues with # some PAM modules and threads) ChallengeResponseAuthentication no # Change to no to disable tunnelled clear text passwords PasswordAuthentication yes # Kerberos options #KerberosAuthentication no #KerberosGetAFSToken no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes X11Forwarding yes X11DisplayOffset 10 PrintMotd no PrintLastLog yes TCPKeepAlive yes #UseLogin no #MaxStartups 10:30:60 #Banner /etc/issue.net # Allow client to pass locale environment variables AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. UsePAM yes IgnoreUserKnownHosts no PasswordAuthentication yes
I've added the last 2 lines in a latest attempt at getting it to work. (I have them on my other vps, and they work there)
Here's the listing of the ~/.ssh/ directory of my user:
ls -la /home/skerit/.ssh total 16 drwx------ 2 skerit skerit 4096 2011-06-25 15:11 . drwxr-xr-x 4 skerit skerit 4096 2011-07-07 21:05 .. -rw-r--r-- 1 skerit skerit 1882 2011-06-25 15:15 authorized_keys -rw-r--r-- 1 skerit skerit 884 2011-06-23 22:59 known_hosts
This is the output of /usr/sbin/sshd -d:
debug1: userauth-request for user skerit service ssh-connection method none debug1: attempt 0 failures 0 debug1: PAM: initializing for "skerit" debug1: PAM: setting PAM_RHOST to "18.104.22.168" debug1: PAM: setting PAM_TTY to "ssh" debug1: userauth-request for user skerit service ssh-connection method publickey debug1: attempt 1 failures 0 debug1: test whether pkalg/pkblob are acceptable debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048 debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048 debug1: temporarily_use_uid: 1000/1000 (e=0/0) debug1: trying public key file /home/skerit/.ssh/authorized_keys debug1: fd 4 clearing O_NONBLOCK debug1: restore_uid: 0/0 debug1: temporarily_use_uid: 1000/1000 (e=0/0) debug1: trying public key file /home/skerit/.ssh/authorized_keys2 debug1: Could not open authorized keys '/home/skerit/.ssh/authorized_keys2': No such file or directory debug1: restore_uid: 0/0 Failed publickey for skerit from 22.214.171.124 port 57154 ssh2 debug1: userauth-request for user skerit service ssh-connection method password debug1: attempt 2 failures 1 debug1: PAM: password authentication failed for skerit: Authentication failure Failed password for skerit from 126.96.36.199 port 57154 ssh2
I then tried to login to the ssh server FROM the ssh server (locally) using THE SAME username and password, and it worked. This was in the auth.log file:
Jul 8 12:21:50 vpsnl1 sshd: debug1: could not open key file '/etc/ssh/ssh_host_ecdsa_key': No such file or directory Jul 8 12:21:50 vpsnl1 sshd: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key Jul 8 12:22:16 vpsnl1 sshd: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=188.8.131.52 user= skerit Jul 8 12:23:50 vpsnl1 sshd: Server listening on 0.0.0.0 port 22. Jul 8 12:23:50 vpsnl1 sshd: Server listening on :: port 22. Jul 8 12:24:07 vpsnl1 sshd: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key Jul 8 12:24:14 vpsnl1 sshd: Accepted password for skerit from 127.0.0.1 port 57667 ssh2 Jul 8 12:24:14 vpsnl1 sshd: pam_unix(sshd:session): session opened for user skerit by (uid=0) Jul 8 12:24:25 vpsnl1 sshd: Received disconnect from 127.0.0.1: 11: disconnected by user Jul 8 12:24:25 vpsnl1 sshd: pam_unix(sshd:session): session closed for user skerit