ssh rsa keys not working or passwordless authentication not working
See It is asking for password
[root@Davinder ~]# ssh 9.109.116.62
The authenticity of host '9.109.116.62 (9.109.116.62)' can't be established.
RSA key fingerprint is 9d:a2:f5:1e:7c:eb:16:bb:ca:b5:0d:fc:fa:56:17:e2.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '9.109.116.62' (RSA) to the list of known hosts.
root@9.109.116.62's password:
check on 9.109.116.62 server
cat .ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAlpKZhORQRSQyf723nBR8PKS0iUGpXWfG261iOd7lKuWpDwlxmFT3bre6tP7ZwFHZOJH8M0iX+B1ZhvV3/7oePPhl+ORUEwmyXPz/RMp1Ruo/YjBJBLY4cGIhlRwLz81dUnaAZzI4RvcPgvPdJqNOmysroWwaPm+JP+hHqNQ7D60=
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAw/8MPiiHAtudCsNEHmeTYxz4oIodsiJUgtSM4NFp8bDoz8WHIBNVhgJRPeVjy9O2A4jfJup/sgx4FLG1ig53lWHCXsMqJUaEjZCIRv+U2bDvqqgCVTzLfCNwaYKLQSsXdq/buts7x++wFvh36wr27aT7vdaRivnWqTmMavENAMUjOU2PzmjcgTHh9tQDyt92Oq5po34oAu1pj/Z5UI301cg72gpXEDDHsjK1UcvdB1VDQlPEInA/wsqZuT8ADdyiizOhtyleG0fwk9QhInMycLsjw47yDjfEOVOwAjiXVG0CgT9TkASWG23JKSV5tXErrfUBG5iT5GvuaSD2DacFqQ== root@xcat
RSA keys are very much right here but still issue to login.
SOLUTION:
selinux is enabled so please disable selinux.
vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@localhost ~]# selinuxenabled 0
[root@localhost ~]# setenforce 0
[root@localhost ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: disabled
Policy version: 24
Policy from config file: targeted
[root@Davinder ~]# ssh 9.109.116.62
The authenticity of host '9.109.116.62 (9.109.116.62)' can't be established.
RSA key fingerprint is 9d:a2:f5:1e:7c:eb:16:bb:ca:b5:0d:fc:fa:56:17:e2.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '9.109.116.62' (RSA) to the list of known hosts.
root@9.109.116.62's password:
check on 9.109.116.62 server
cat .ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAlpKZhORQRSQyf723nBR8PKS0iUGpXWfG261iOd7lKuWpDwlxmFT3bre6tP7ZwFHZOJH8M0iX+B1ZhvV3/7oePPhl+ORUEwmyXPz/RMp1Ruo/YjBJBLY4cGIhlRwLz81dUnaAZzI4RvcPgvPdJqNOmysroWwaPm+JP+hHqNQ7D60=
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAw/8MPiiHAtudCsNEHmeTYxz4oIodsiJUgtSM4NFp8bDoz8WHIBNVhgJRPeVjy9O2A4jfJup/sgx4FLG1ig53lWHCXsMqJUaEjZCIRv+U2bDvqqgCVTzLfCNwaYKLQSsXdq/buts7x++wFvh36wr27aT7vdaRivnWqTmMavENAMUjOU2PzmjcgTHh9tQDyt92Oq5po34oAu1pj/Z5UI301cg72gpXEDDHsjK1UcvdB1VDQlPEInA/wsqZuT8ADdyiizOhtyleG0fwk9QhInMycLsjw47yDjfEOVOwAjiXVG0CgT9TkASWG23JKSV5tXErrfUBG5iT5GvuaSD2DacFqQ== root@xcat
RSA keys are very much right here but still issue to login.
SOLUTION:
selinux is enabled so please disable selinux.
vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing ----> change to disabled
# SELINUXTYPE= can take one of these two values:# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@localhost ~]# selinuxenabled 0
[root@localhost ~]# setenforce 0
[root@localhost ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: disabled
Policy version: 24
Policy from config file: targeted
Comments
Post a Comment