ssh免密钥登录的坑

有工程通过页面上不小心把/home/admin下面所有目前都改成777后,导致.ssh改成700也不管用,~/.ssh/authorized_keys就算改成了600都不管用的场景。SSH的免密钥登录永远都不能成功。

Connection to hsslave3 closed.
[admin@hsmaster .ssh]$ ssh-copy-id hsslave4
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
admin@hsslave4's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'hsslave4'"
and check to make sure that only the key(s) you wanted were added.

[admin@hsmaster .ssh]$ ssh hsslave4
Last login: Fri Apr 12 15:00:13 2019
[admin@hsslave4 ~]$ exit;
登出
Connection to hsslave4 closed.
[admin@hsmaster .ssh]$ ssh-copy-id localhost
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is e4:ba:d6:b9:68:43:7d:81:4a:d9:3d:77:f9:1e:9a:c1.
Are you sure you want to continue connecting (yes/no)? yes
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
admin@localhost's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'localhost'"
and check to make sure that only the key(s) you wanted were added.

[admin@hsmaster .ssh]$ ssh localhost
admin@localhost's password: 
Last login: Fri Apr 12 17:18:05 2019 from hsmaster
[admin@hsmaster ~]$ exit;
登出
Connection to localhost closed.
[admin@hsmaster .ssh]$ ssh localhost
admin@localhost's password: 
Last login: Fri Apr 12 17:25:51 2019 from localhost

你可能感兴趣的:(大数据安装)