SSH connected FAILED with message: SSH_MSG_USERAUTH_FAILURE: publickey,password | Ottomatik

SSH connected FAILED with message: SSH_MSG_USERAUTH_FAILURE: publickey,password

SSH connected FAILED with message: SSH_MSG_USERAUTH_FAILURE: publickey,password

 

There can be many issues with this, please note, if you are not seeing the 'publickey' in the message, this means you do not have publickey authentication turned on.

 

 

We can try updating the permissions of the authorized_keys file and also adjust some further settings to fix this.

$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/authorized_keys


If that does not solve the problem you may try temporarily setting StrictModes to no in /etc/ssh/sshd_config. If authentication with StrictModes off is successful, it is likely an issue with file permissions persists.


Make sure keys in ~/.ssh/authorized_keys are entered correctly and only use one single line.


You may want to use debug mode and monitor the output while connecting:
# /usr/bin/sshd -d

Source: https://wiki.archlinux.org/index.php/SSH_keys