# Ansible Authentication or permission failure

**URL:** <https://forum.ansible.com/t/ansible-authentication-or-permission-failure/30897>\
**Category:** Ansible Project\
**Created:** [July 29, 2019, 9:19pm UTC](https://forum.ansible.com/t/ansible-authentication-or-permission-failure/30897 "2019-07-29T21:19:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamran\_taherpour](https://avatars.discourse-cdn.com/v4/letter/k/6de8d8/32.png) [@kamran\_taherpour](https://forum.ansible.com/u/kamran_taherpour)\
**Post date:** [July 29, 2019, 9:19pm UTC](https://forum.ansible.com/t/ansible-authentication-or-permission-failure/30897/1 "2019-07-29T21:19:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Richard\_James\_Salts](https://avatars.discourse-cdn.com/v4/letter/r/3ab097/32.png) [@Richard\_James\_Salts](https://forum.ansible.com/u/Richard_James_Salts)\
**Post date:** [July 29, 2019, 11:20pm UTC](https://forum.ansible.com/t/ansible-authentication-or-permission-failure/30897/2 "2019-07-29T23:20:35Z")

</div>

> 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.
