Why does SSH public key authentication fail with "mm_answer_keyallowed: key XYZ is not allowed" messages in sshd debug logs?
Issue
- SSH public key authentication fails after copying public key to
authorized_keys
. - Following messages observed in
sshd
debug logs.
Feb 25 10:14:18 instance1 sshd[27306]: debug1: trying public key file /var/www/.ssh/authorized_keys2
Feb 25 10:14:18 instance1 sshd[27306]: debug1: restore_uid: 0/0
Feb 25 10:14:18 instance1 sshd[27306]: Failed publickey for deploy from 10.254.91.65 port 36429 ssh2
Feb 25 10:14:18 instance1 sshd[27306]: debug3: mm_answer_keyallowed: key 0x7fa8383d44f0 is not allowed
- Following steps does not help to resolve the issue.
Setting 'StrictModes' to 'no'.
Assigning password for user.
Checking all file permissions.
Verifying `md5sum` for `id_rsa.pub` and `authorized_keys` are same.
Environment
- Red Hat Enterprise Linux 6.4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.