Error
root@DESKTOP-94AUF6U:~# ansible all -i 18.208.198.47,172.22.240.232, -m apt -a"name=apache2 state=present" -u ubuntu -k -b
SSH password:
172.22.240.232 | FAILED! => {
"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."
}
18.208.198.47 | FAILED! => {
"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."
Solution
Step - 1
Run following commands in each ARS
$ apt update
$ apt install sshpass
Step - 2
Modify /etc/ansible/ansible.cfg in ACS
$ vi /etc/ansible/ansible.cfg
[defaults]
host_key_checking = False
Error
root@DESKTOP-94AUF6U:~# ansible all -i 18.208.198.47,172.22.240.232, -m apt -a"name=apache2 state=present" -u ubuntu -k -b
SSH password:
172.22.240.232 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to create temporary directory. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /home/ubuntu/.ansible/tmp `\"&& mkdir \"` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1692676517.394163-1957-255011346482889 `\" && echo ansible-tmp-1692676517.394163-1957-255011346482889=\"` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1692676517.394163-1957-255011346482889 `\" ), exited with result 1",
"unreachable": true
}
18.208.198.47 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: Warning: Permanently added '18.208.198.47' (ED25519) to the list of known hosts.\r\nubuntu@18.208.198.47: Permission denied (publickey).",
"unreachable": true
}
Answer – user’s right access is not set with their directory

Latest posts by rajeshkumar (see all)
- How to get Blackduck Trial version? - December 3, 2023
- PHP ionCube Error: cannot be decoded by this version of the ionCube Loader - December 2, 2023
- Cloudbees CD/RO Error: ectool - November 24, 2023