msg Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this

+1 vote

Hi Guys,

I am trying to ping all the managed nodes using Ansible, but it is showing me the below error.

 "msg": "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."
Aug 1, 2020 in Ansible by akhtar
• 38,240 points
34,268 views

1 answer to this question.

+2 votes

Hi@akhtar,

You are getting this error because when we do SSH in the remote system it will ask yes or no. But Ansible doesn't have the capability to ask this in run time. So you need to disable host_key_checking in your ansible.conf file as shown below.

[root@localhost ~]# vim /etc/ansible/ansible.cfg
[defaults]
inventory = /etc/hostfile.txt
host_key_checking = False
answered Aug 1, 2020 by MD
• 95,440 points

Related Questions In Ansible

+1 vote
1 answer

Is it possible to append a large amount of text to a file using Ansible?

Here is concept which you can follow. blockinfile is ...READ MORE

answered Jul 30, 2018 in Ansible by Atul
• 10,240 points
14,272 views