快捷搜索:

Linux下处理ssh连接出现Are you sure you want to continue connecting

解决办法:

echo '
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null' >>/root/.ssh/config

上面处理的是root用户,如果是其他用户的话,将配置写到该用户家目录的.ssh/config即可。

或者直接将以上配置写到/etc/ssh/ssh_config,这样就是全局策略了。

还有一种办法,连接ssh的时候,带上GSSAPIAuthentication=no参数:

ssh -o GSSAPIAuthentication=no root@192.168.111.22
这样也可以避免需要二次确认连接。

您可能还会对下面的文章感兴趣: