#设置一个空的私钥 ssh-keygen -f /root/.ssh/id_rsa -N "" #id_rsa.pub变成authorized_keys mv /root/.ssh/{id_rsa.pub,authorized_keys} #将.ssh目录整个拷贝到其他主机 scp -r /root/.ssh IP:/root
免除询问yes/no
vim /etc/ssh/ssh_config
修改 StrictHostKeyChecking ask 为 StrictHostKeyChecking no,并取消注释