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

每次ssh 进入一台新机器都会跳出如下的提示:

The authenticity of host '111.222.333.444 (111.222.333.444)' can't be established.
RSA key fingerprint is f3:cf:58:ae:71:0b:c8:04:6f:34:a3:b2:e4:1e:0c:8b.
Are you sure you want to continue connecting (yes/no)? 

感觉很烦,有以下方法可以解决这个问题:

 

1. 加入一个参数:

ssh -o "StrictHostKeyChecking no" user@host

 

2.修改配置文件

在文件/etc/ssh/ssh_config(全局)或者~/.ssh/config(某用户)开头加入以下内容:

 

Host 192.168.0.*

   StrictHostKeyChecking no

   UserKnownHostsFile=/dev/null

 

or 

 

Host *
   StrictHostKeyChecking no
   UserKnownHostsFile=/dev/null

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2019-09-26
  • 2021-10-08
  • 2021-03-15
  • 2021-09-29
  • 2021-08-09
  • 2021-12-23
猜你喜欢
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2021-06-26
  • 2021-07-26
  • 2021-06-28
相关资源
相似解决方案