SSH Passwordless Login Fails
by dervish on Oct.24, 2012, under Red Hat
After verifying file permissions, still unable to login without entering passsord. Found issue where SELINUX was keeping the SSH service from reading the authorized_keys file. Issue encountered on a Red Hat 6 server.
Fix:
$ restorecon -R -v /home/user/.ssh
restorecon reset /home/user/.ssh context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:ssh_home_t:s0
restorecon reset /home/user/.ssh/known_hosts context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:ssh_home_t:s0
restorecon reset /home/user/.ssh/id_dsa context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:ssh_home_t:s0
restorecon reset /home/user/.ssh/id_dsa.pub context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:ssh_home_t:s0
restorecon reset /home/user/.ssh/authorized_keys context unconfined_u:object_r:home_root_t:s0->unconfined_u:object_r:ssh_home_t:s0
Passwordless login now works:
$ ssh gilis28.fls
Last login: Wed Oct 3 14:07:00 2012 from 10.255.2.204
[user@GILIS28 ~]$
Leave a Reply
You must be logged in to post a comment.