ansible禁用 SSH 主机密钥检查

问题:

Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host's fingerprint to your known_hosts file to manage this host.

 

可以通过在 ansible.cfg 文件中禁用 SSH 的主机密钥检查功能。这样可以跳过对 known_hosts 文件中的条目的验证:

在你的 ansible.cfg 文件中,添加以下内容:

[defaults]
host_key_checking = False

posted @ 2024-09-12 10:35  LB_运维技术  阅读(15)  评论(0编辑  收藏  举报