linux中ssh登陸Permanently added (RSA) to the list of known hosts問題解決
用用戶名+密碼的方式登陸出現如下問題:
1
[root@www]# ssh admin@xxx.xxx.xxx.xxx
2
The authenticity of host 'xxx.xxx.xxx.xxx can't be established.
3
RSA key fingerprint is f4:d0:1a:9c:09:65:78:71:25:33:79:c2:d5:aa:0b:c1.
4
Are you sure you want to continue connecting (yes/no)? no
5
Host key verification failed.
6
[root@www]#
若是是直接輸入yes
1
[root@www]# ssh admin@xxx.xxx.xxx.xx
2
The authenticity of host 'xxx.xxx.xxx.xxx' can't be established.
3
RSA key fingerprint is f4:d0:1a:9c:09:65:78:71:25:33:79:c2:d5:aa:0b:c1.
4
Are you sure you want to continue connecting (yes/no)? yes
5
Warning: Permanently added 'xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.
6
Permission denied (publickey,gssapi-with-mic,password).
7
[root@www]#
1、能夠把~/.ssh/known_hosts清除
2、若是仍是不行
修改/etc/ssh/sshd-config文件,將其中的PermitRootLogin no修改成yes,PubkeyAuthentication yes修改成no,AuthorizedKeysFile .ssh/authorized_keys前面加上#屏蔽掉,PasswordAuthentication no修改成yes就能夠了。
3、若是仍是有問題,那顆一用下面的方式解決:
用命令 ssh -l username hostname
1
Are you sure you want to continue connecting (yes/no)?
一、這個是ssh安全認證是的一個RSA認證。此處必須選擇yes才能鏈接。
第一次yes後,他會詢問你是否永久把這個RSA認證加入本地,選擇yes後,之後不會再出現提醒。
每次登錄只須要輸入密碼便可。
二、也能夠不用輸入1中的yes,可是須要修改本機配置。
1
/etc/ssh/ssh_config 中的
2
# StrictHostKeyChecking ask 改爲
3
StrictHostKeyChecking no