RedHat 6/Oracle Linux 6 is not allowing key authentication via ssh

Olivier Refalo picture Olivier Refalo · Mar 16, 2012 · Viewed 20.9k times · Source

Keys are properly deployed in ~/.ssh/authorized_keys

Yet ssh keeps on prompting for a password.

Answer

Olivier Refalo picture Olivier Refalo · Mar 16, 2012

Several issues, mostly privileges - but also related to SELinux on RedHat 6

The following script should fix them all, please replace <user>:<group> with your matching userid and group

chown -R <user>:<group> ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
restorecon -R -v ~/.ssh