Ansible Authentication or permission failure

Hi,
I’m receiving following error for Ansible ping command

<10.26.64.67> Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: /etc/ssh/ssh_config line 58: Applying options for *

debug1: auto-mux: Trying existing master

debug2: fd 3 setting O_NONBLOCK

debug2: mux_client_hello_exchange: master version 4

debug3: mux_client_forwards: request forwardings: 0 local, 0 remote

debug3: mux_client_request_session: entering

debug3: mux_client_request_alive: entering

debug3: mux_client_request_alive: done pid = 74588

debug3: mux_client_request_session: session request sent

debug1: mux_client_request_session: master session id: 2

debug3: mux_client_read_packet: read header failed: Broken pipe

debug2: Received exit status from master 16

10.26.64.67 | UNREACHABLE! => {

“changed”: false,

“msg”: “Authentication or permission failure. 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". Failed command was: ( umask 77 && mkdir -p "echo $HOME/.ansible/tmp/ansible-tmp-1564434437.1-91337190616020" && echo ansible-tmp-1564434437.1-91337190616020="echo $HOME/.ansible/tmp/ansible-tmp-1564434437.1-91337190616020" ), exited with result 16, stdout output: Syntax error while parsing ‘/bin/sh -c ‘( umask 77 && mkdir -p "echo $HOME/.ansible/tmp/ansible-tmp-1564434437.1-91337190616020" && echo ansible-tmp-1564434437.1-91337190616020="echo $HOME/.ansible/tmp/ansible-tmp-1564434437.1-91337190616020" ) && sleep 0’’\n\n\nCmd exec error.\n, stderr output: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 74588\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 16\r\n”,

“unreachable”: true

Here is Ansible.cfg

[defaults]

inventory = /opt/ansible/hosts

gathering = explicit

host_key_checking = False

remote_tmp = $HOME/.ansible/tmp

timeout = 300

retry_files_enabled = False

#callback_whitelist = timer, mail

callback_whitelist = profile_tasks

[callback_profile_tasks]

sort_order = none

task_output_limit = 200

#[inventory]

[privilege_escalation]

[paramiko_connection]

[ssh_connection]

[persistent_connection]

command_timeout = 600

connect_timeout = 600

connect_retry_timeout = 60

[accelerate]

[selinux]

[colors]

[diff]

even I changed remote_tmp to /tmp or /.ansible-${USER}/tmp but still the same.

[root@xxxx ansible]# ls -ld $HOME/.ansible/tmp

drwxrwxrwt 63 root root 4096 Jul 29 21:07 /root/.ansible/tmp

Can you please help?

Thanks

Hi,

I’m receiving following error for Ansible ping command

<10.26.64.67> Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL

1.0.2k-fips 26 Jan 2017

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: /etc/ssh/ssh_config line 58: Applying options for *

debug1: auto-mux: Trying existing master

debug2: fd 3 setting O_NONBLOCK

debug2: mux_client_hello_exchange: master version 4

debug3: mux_client_forwards: request forwardings: 0 local, 0 remote

debug3: mux_client_request_session: entering

debug3: mux_client_request_alive: entering

debug3: mux_client_request_alive: done pid = 74588

debug3: mux_client_request_session: session request sent

debug1: mux_client_request_session: master session id: 2

debug3: mux_client_read_packet: read header failed: Broken pipe

debug2: Received exit status from master 16

10.26.64.67 | UNREACHABLE! => {

“changed”: false,

“msg”: "Authentication or permission failure. 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". Failed command was: ( umask 77 && mkdir -p "` echo

$HOME/.ansible/tmp/ansible-tmp-1564434437.1-91337190616020 `" && echo

ansible-tmp-1564434437.1-91337190616020="` echo

$HOME/.ansible/tmp/ansible-tmp-1564434437.1-91337190616020 `" ), exited

with result 16, stdout output: Syntax error while parsing '/bin/sh -c '(

umask 77 && mkdir -p "` echo

$HOME/.ansible/tmp/ansible-tmp-1564434437.1-91337190616020 `" && echo

ansible-tmp-1564434437.1-91337190616020="` echo

$HOME/.ansible/tmp/ansible-tmp-1564434437.1-91337190616020 `" ) && sleep

0’'\n\n\nCmd exec error.\n, stderr output: OpenSSH_7.4p1, OpenSSL

1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data

/etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying

options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3

setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version

4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0

remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3:

mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive:

done pid = 74588\r\ndebug3: mux_client_request_session: session request

sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3:

mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received

exit status from master 16\r\n",

bash exits with the exit value of the last command. Which in your case is 16.

From errno.h:

#define EBUSY 16 /* Device or resource busy */

Try running the ssh command manually, it’s possible it’s something weird on the filesystem. My guess is though, that the ssh master socket is not working for some reason where you see the Broken pipe later on.