ansible Q&A: Failed to connect to the host via ssh: ssh_exchange_identification and Authentication or per

This document documents the errors and solutions encountered in using ansible.
Problem 1:[[email protected] -10-1-241-158 logs]# ssh 10.1.241.161
Read: Reset connection by peer point
ips10.1.241.159 | out of reach! = than; {
“change”:false ,
“msg”: “Connection failed via ssh: ssh_exchange_identification: read: peer\r\n reset”.
“Access”:really
}
Executable root10.1.241.161 -m shell -a ‘pwd’
| rc=0
module failed[[email protected] -10-1-241-158 logs]# ansible ips10.1.241.161 -m shell -a ‘pwd’
ips10.1.241.161 | out of reach! = than; {
“change”:false ,
“MSG”: “Authentication failed.”
“Access”:True.
}

Positioned because.
10.1.241.161 On the host computer
vi /etc/hosts.deny
Available sshd, sftp, telnet, ftp: 10.1.241.158
How to unlock / etc/hosts.deny
161 on implementation.
service denyhosts stop
Send DenyHosts SIGTERM
vi /etc/hosts.deny, delete the corresponding host information.

Authentication failed.” The error is because the user of :/ etc/ansible /host, does not have sudo privileges on the connected host:
vi /etc/sudoers
Just add the corresponding permissions.

Ansible reporting error: “Failed to connect to host via ssh:ssh_exchange_identification:read:connection reset peer \ r \ n”
ips10.1.241.159 | out of reach! = than; {
“change”:false ,
“msg”: “Connection failed via ssh: ssh_exchange_identification: read: peer\r\n reset”.
“Access”:really
}

Solution.
Service denyhosts stop
Cat/ dev/null in / etc/hosts.deny
Question 2.
ansible execution error: authentication or permission failure
+ ansible IPSMachines -m shell – ‘pwd’
root10.1.235.28 | out of reach! = than;{
“change”: false,
“Authentication or Permissions Failed.” In some cases, you may have been able to authenticate and have no permissions to the remote directory. Consider changing the remote temporary path in the ansibl .cfg to one rooted in \”/tmp\”. The failed command is:(umask 77 &amp &mkdir -p \\” ‘ echo $HOME/.ansible/tmp/ ansibler -tmp-1536806706.35-106960540689166 ‘ \”echo $ ansible-tmp-1536806706.35-106960540689166 ‘ \”), exit result 1″.
“Access”:really
}
root10.1.235.27 | out of reach! = than;{
“change”: false,
“Authentication or Permissions Failed.” In some cases, you may have been able to authenticate and have no permissions to the remote directory. Consider changing the remote temporary path in the ansibl .cfg to one rooted in \”/tmp\”. The command that fails is:(umask 77 &amp &mkdir -p \\” echo $HOME/.ansible/tmp/ ansibler -tmp-1536806706.35-1073010745840 ‘ \”echo $ ansible-‘ tmp-1536806706.35- 10730745840 ‘ \”), exit result 1,”
“Access”:really
}

The reason for this is that the password of the ansible user on the logged in host is incorrect, or the password has expired, just change the password of the corresponding user to the correct one;

Read More: