发现在删掉 ~/.ssh/know_hosts 之后运行 ansible api 会出现以下提示

The authenticity of host '10.1.*.* (10.1.*.*)' can't be established.
RSA key fingerprint is 43:54:a5:c0:f8:4a:a2:d2:1a:ef:87:8f:90:f5:dd:4a.
Are you sure you want to continue connecting (yes/no)?

因为在脚本里面自动运行调用,无法使用 pexpect 模块,也无法捕捉到 这段提示的输出,ansible 源码研究不够透彻搞了半天也没解决,最后只能从根本途径上面解决问题,直接修改 ssh 配置,去掉该段提示。

vim /etc/ssh/ssh_config 


Host *
    StrictHostKeyChecking no

重启 sshd

service sshd restart

 

相关文章:

  • 2020-04-27
  • 2020-02-22
  • 2021-11-12
  • 2021-11-09
  • 2021-06-13
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案