在~/.ssh/下建立config文件,内容为StrictHostKeyChecking no,ssh连接时将自动进行添加,即可免输入yes进行known_hosts添加, 如果想在服务器ip更改后仍然无需进行更新known_hosts文件,或者想免除known_hosts未更新导致的冲突,可以再在~/.ssh/config中多添加一行UserKnownHostsFile /dev/null,即可时时删除known_hosts文件...
[root@bigdata-server-01.ssh]# cat /usr/hadoop/.ssh/known_hosts; localhost ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKVJATfy765ZoMvOxe7/wIA2Y5OCLMoFVaFRPUHoLmZbLO+Drj9rj8yqKenWv5wylrJKZnSVOQvS3tb7Cb2IqIY=bigdata-server-02,120.78.187.241ecdsa-sha2-nistp2...
[root@bigdata-server-01.ssh]# cat /usr/hadoop/.ssh/known_hosts; localhost ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKVJATfy765ZoMvOxe7/wIA2Y5OCLMoFVaFRPUHoLmZbLO+Drj9rj8yqKenWv5wylrJKZnSVOQvS3tb7Cb2IqIY=bigdata-server-02,120.78.187.241ecdsa-sha2-nistp2...
[root@bigdata-server-01~]# cat /etc/ssh/sshd_config# $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $# This is the sshd server system-wide configuration file. See# sshd_config(5) for more information.# This sshd was compiled with PATH=/usr/local/bin:/usr/bin# The s...
--- 您的帖子很精彩!希望很快能再分享您的下一帖!
authorized_keys 是执行ssh host1后程序在目的地host创建的文件,而出发地的kownhosts的文件会被追加。 【学习路径】 1-看执行过程中的窗口输出语句; 2-比较执行前后的出发地、目的地的文件新增情况、文件内容的新增情况; 1 2 3 4 5 6 7 8 9 10