解決linux中ssh登錄Warning:Permanently added (RSA) to the list of known hosts


原因:

在執行scp id_rsa.pub root@hostname:/root/.ssh這一步時,沒在本機的/root/.ssh下生成known_hosts文件。

 

解決方案:

vi /etc/ssh/ssh_config

最后有兩行是

         StrictHostKeyChecking no

         UserKnownHostsFile /dev/null

把這兩行注釋掉並保存文件

再次執行scp id_rsa.pub root@host141:/root/.ssh

出現提示

The authenticity of host 'host141 (172.20.0.141)' can't be established.

RSA key fingerprint is a0:09:89:d2:3b:aa:91:60:59:7f:7f:bc:03:31:b0:09.

Are you sure you want to continue connecting (yes/no)? 

輸入yes后,則可看到在/root/.ssh目錄下生成了known_hosts文件:

[root@SamuluIndex .ssh]# ls

id_rsa  id_rsa.pub  known_hosts

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM