# "become" not working on centos 7 hosts

**URL:** <https://forum.ansible.com/t/become-not-working-on-centos-7-hosts/29352>\
**Category:** Ansible Project\
**Created:** [January 2, 2019, 1:57pm UTC](https://forum.ansible.com/t/become-not-working-on-centos-7-hosts/29352 "2019-01-02T13:57:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![John.1209](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@John.1209](https://forum.ansible.com/u/John.1209)\
**Post date:** [January 2, 2019, 1:57pm UTC](https://forum.ansible.com/t/become-not-working-on-centos-7-hosts/29352/1 "2019-01-02T13:57:42Z")

</div>

I’ve got ansible setup in a centos 6 & 7 environment. The Centos 6 hosts all work fine. The centos 7 hosts work, but I cannot use “become” with centos 7. It works with Centos 6, and non-root commands work with centos 7. Here is a snippet from the debug log

`

[MyAccunt@util07 ~]$ ansible TargetHost -a “echo hello” --become -vvvvv  
ansible 2.4.2.0  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/home/MyAccunt/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/site-packages/ansible  
executable location = /usr/bin/ansible  
python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]  
Using /etc/ansible/ansible.cfg as config file  
setting up inventory plugins  
Parsed /etc/ansible/hosts inventory source with ini plugin  
Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/ **init**.pyc  
META: ran handlers  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/basic.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/\_text.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/parsing/convert\_bool.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/parsing/ **init**.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/pycompat24.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/six/ **init**.py  
Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py  
 ESTABLISH SSH CONNECTION FOR USER: None  
 SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
 SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
 SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
 SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4)  
 SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4 TargetHost ‘/bin/sh -c ‘"’“‘echo ~ && sleep 0’”’“‘’  
 (0, ‘/home/MyAccunt\n’, ‘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\ndebug1: Control socket “/home/MyAccunt/.ansible/cp/90b7a51bf4” does not exist\r\ndebug2: resolving “TargetHost” port 22\r\ndebug2: ssh\_connect\_direct: needpriv 0\r\ndebug1: Connecting to TargetHost [172.17.4.39] port 22.\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug1: fd 3 clearing O\_NONBLOCK\r\ndebug1: Connection established.\r\ndebug3: timeout: 9999 ms remain after connect\r\ndebug1: key\_load\_public: No such file or directory\r\ndebug1: identity file /home/MyAccunt/.ssh/id\_rsa type -1\r\ndebug1: key\_load\_public: No such file or directory\r\ndebug1: identity file /home/MyAccunt/.ssh/id\_rsa-cert type -1\r\ndebug1: key\_load\_public: No such file or directory\r\ndebug1: identity file /home/MyAccunt/.ssh/id\_dsa type -1\r\ndebug1: key\_load\_public: No such file or directory\r\ndebug1: identity file /home/MyAccunt/.ssh/id\_dsa-cert type -1\r\ndebug1: key\_load\_public: No such file or directory\r\ndebug1: identity file /home/MyAccunt/.ssh/id\_ecdsa type -1\r\ndebug1: key\_load\_public: No such file or directory\r\ndebug1: identity file /home/MyAccunt/.ssh/id\_ecdsa-cert type -1\r\ndebug1: key\_load\_public: No such file or directory\r\ndebug1: identity file /home/MyAccunt/.ssh/id\_ed25519 type -1\r\ndebug1: key\_load\_public: No such file or directory\r\ndebug1: identity file /home/MyAccunt/.ssh/id\_ed25519-cert type -1\r\ndebug1: Enabling compatibility mode for protocol 2.0\r\ndebug1: Local version string SSH-2.0-OpenSSH\_7.4\r\ndebug1: Remote protocol version 2.0, remote software version OpenSSH\_7.4\r\ndebug1: match: OpenSSH\_7.4 pat OpenSSH_ compat 0x04000000\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug1: Authenticating to TargetHost:22 as 'MyAccunt'\r\ndebug3: hostkeys\_foreach: reading file “/home/MyAccunt/.ssh/known\_hosts”\r\ndebug3: record\_hostkey: found key type ECDSA in file /home/MyAccunt/.ssh/known\_hosts:105\r\ndebug3: load\_hostkeys: loaded 1 keys from TargetHost\r\ndebug3: order\_hostkeyalgs: prefer hostkeyalgs: [ecdsa-sha2-nistp256-cert-v01@openssh.com](mailto:ecdsa-sha2-nistp256-cert-v01@openssh.com),ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521\r\ndebug3: send packet: type 20\r\ndebug1: SSH2\_MSG\_KEXINIT sent\r\ndebug3: receive packet: type 20\r\ndebug1: SSH2\_MSG\_KEXINIT received\r\ndebug2: local client KEXINIT proposal\r\ndebug2: KEX algorithms: [curve25519-sha256,curve25519-sha256@libssh.org](mailto:curve25519-sha256,curve25519-sha256@libssh.org),ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,ext-info-c\r\ndebug2: host key algorithms: [ecdsa-sha2-nistp256-cert-v01@openssh.com](mailto:ecdsa-sha2-nistp256-cert-v01@openssh.com),ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss\r\ndebug2: ciphers ctos: [chacha20-poly1305@openssh.com](mailto:chacha20-poly1305@openssh.com),aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc\r\ndebug2: ciphers stoc: [chacha20-poly1305@openssh.com](mailto:chacha20-poly1305@openssh.com),aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc\r\ndebug2: MACs ctos: [umac-64-etm@openssh.com](mailto:umac-64-etm@openssh.com),umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: MACs stoc: [umac-64-etm@openssh.com](mailto:umac-64-etm@openssh.com),umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: compression ctos: [zlib@openssh.com](mailto:zlib@openssh.com),zlib,none\r\ndebug2: compression stoc: [zlib@openssh.com](mailto:zlib@openssh.com),zlib,none\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first\_kex\_follows 0 \r\ndebug2: reserved 0 \r\ndebug2: peer server KEXINIT proposal\r\ndebug2: KEX algorithms: [curve25519-sha256,curve25519-sha256@libssh.org](mailto:curve25519-sha256,curve25519-sha256@libssh.org),ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\ndebug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519\r\ndebug2: ciphers ctos: [chacha20-poly1305@openssh.com](mailto:chacha20-poly1305@openssh.com),aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc\r\ndebug2: ciphers stoc: [chacha20-poly1305@openssh.com](mailto:chacha20-poly1305@openssh.com),aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc\r\ndebug2: MACs ctos: [umac-64-etm@openssh.com](mailto:umac-64-etm@openssh.com),umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: MACs stoc: [umac-64-etm@openssh.com](mailto:umac-64-etm@openssh.com),umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: compression ctos: [none,zlib@openssh.com](mailto:none,zlib@openssh.com)\r\ndebug2: compression stoc: [none,zlib@openssh.com](mailto:none,zlib@openssh.com)\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first\_kex\_follows 0 \r\ndebug2: reserved 0 \r\ndebug1: kex: algorithm: curve25519-sha256\r\ndebug1: kex: host key algorithm: ecdsa-sha2-nistp256\r\ndebug1: kex: server-\>client cipher: [chacha20-poly1305@openssh.com](mailto:chacha20-poly1305@openssh.com) MAC: compression: [zlib@openssh.com](mailto:zlib@openssh.com)\r\ndebug1: kex: client-\>server cipher: [chacha20-poly1305@openssh.com](mailto:chacha20-poly1305@openssh.com) MAC: compression: [zlib@openssh.com](mailto:zlib@openssh.com)\r\ndebug1: kex: curve25519-sha256 need=64 dh\_need=64\r\ndebug1: kex: curve25519-sha256 need=64 dh\_need=64\r\ndebug3: send packet: type 30\r\ndebug1: expecting SSH2\_MSG\_KEX\_ECDH\_REPLY\r\ndebug3: receive packet: type 31\r\ndebug1: Server host key: ecdsa-sha2-nistp256 SHA256:X54ISuDIQEt00hLUFm2nEMwWWDsVbxUoXAup+Od6nfQ\r\ndebug3: hostkeys\_foreach: reading file “/home/MyAccunt/.ssh/known\_hosts”\r\ndebug3: record\_hostkey: found key type ECDSA in file /home/MyAccunt/.ssh/known\_hosts:105\r\ndebug3: load\_hostkeys: loaded 1 keys from TargetHost\r\ndebug3: hostkeys\_foreach: reading file “/home/MyAccunt/.ssh/known\_hosts”\r\ndebug3: record\_hostkey: found key type ECDSA in file /home/MyAccunt/.ssh/known\_hosts:104\r\ndebug3: load\_hostkeys: loaded 1 keys from 172.17.4.39\r\ndebug1: Host 'TargetHost' is known and matches the ECDSA host key.\r\ndebug1: Found key in /home/MyAccunt/.ssh/known\_hosts:105\r\ndebug3: send packet: type 21\r\ndebug2: set\_newkeys: mode 1\r\ndebug1: rekey after 134217728 blocks\r\ndebug1: SSH2\_MSG\_NEWKEYS sent\r\ndebug1: expecting SSH2\_MSG\_NEWKEYS\r\ndebug3: receive packet: type 21\r\ndebug1: SSH2\_MSG\_NEWKEYS received\r\ndebug2: set\_newkeys: mode 0\r\ndebug1: rekey after 134217728 blocks\r\ndebug2: key: /home/MyAccunt/.ssh/id\_rsa ((nil))\r\ndebug2: key: /home/MyAccunt/.ssh/id\_dsa ((nil))\r\ndebug2: key: /home/MyAccunt/.ssh/id\_ecdsa ((nil))\r\ndebug2: key: /home/MyAccunt/.ssh/id\_ed25519 ((nil))\r\ndebug3: send packet: type 5\r\ndebug3: receive packet: type 7\r\ndebug1: SSH2\_MSG\_EXT\_INFO received\r\ndebug1: kex\_input\_ext\_info: server-sig-algs=\<rsa-sha2-256,rsa-sha2-512\>\r\ndebug3: receive packet: type 6\r\ndebug2: service\_accept: ssh-userauth\r\ndebug1: SSH2\_MSG\_SERVICE\_ACCEPT received\r\ndebug3: send packet: type 50\r\ndebug3: receive packet: type 51\r\ndebug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password\r\ndebug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password\r\ndebug3: preferred gssapi-with-mic,gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod\_lookup gssapi-with-mic\r\ndebug3: remaining preferred: gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod\_is\_enabled gssapi-with-mic\r\ndebug1: Next authentication method: gssapi-with-mic\r\ndebug1: Unspecified GSS failure. Minor code may provide more information\nNo Kerberos credentials available (default cache: KEYRING:persistent:1004)\n\r\ndebug1: Unspecified GSS failure. Minor code may provide more information\nNo Kerberos credentials available (default cache: KEYRING:persistent:1004)\n\r\ndebug2: we did not send a packet, disable method\r\ndebug3: authmethod\_lookup gssapi-keyex\r\ndebug3: remaining preferred: hostbased,publickey\r\ndebug3: authmethod\_is\_enabled gssapi-keyex\r\ndebug1: Next authentication method: gssapi-keyex\r\ndebug1: No valid Key exchange context\r\ndebug2: we did not send a packet, disable method\r\ndebug3: authmethod\_lookup publickey\r\ndebug3: remaining preferred: ,publickey\r\ndebug3: authmethod\_is\_enabled publickey\r\ndebug1: Next authentication method: publickey\r\ndebug1: Trying private key: /home/MyAccunt/.ssh/id\_rsa\r\ndebug3: sign\_and\_send\_pubkey: RSA SHA256:jxCzE7Mwicf5+u+FqDkpL+12Gj+pi2pG/BB3wFUPz0I\r\ndebug3: send packet: type 50\r\ndebug2: we sent a publickey packet, wait for reply\r\ndebug3: receive packet: type 52\r\ndebug1: Enabling compression at level 6.\r\ndebug1: Authentication succeeded (publickey).\r\nAuthenticated to TargetHost ([172.17.4.39]:22).\r\ndebug1: setting up multiplex master socket\r\ndebug3: muxserver\_listen: temporary control path /home/MyAccunt/.ansible/cp/90b7a51bf4.4RKcE1Mf4P6WlvqK\r\ndebug2: fd 4 setting O\_NONBLOCK\r\ndebug3: fd 4 is O\_NONBLOCK\r\ndebug3: fd 4 is O\_NONBLOCK\r\ndebug1: channel 0: new [/home/MyAccunt/.ansible/cp/90b7a51bf4]\r\ndebug3: muxserver\_listen: mux listener channel 0 fd 4\r\ndebug2: fd 3 setting TCP\_NODELAY\r\ndebug3: ssh\_packet\_set\_tos: set IP\_TOS 0x08\r\ndebug1: control\_persist\_detach: backgrounding master process\r\ndebug2: control\_persist\_detach: background process is 5878\r\ndebug2: fd 4 setting O\_NONBLOCK\r\ndebug1: forking to background\r\ndebug1: Entering interactive session.\r\ndebug1: pledge: id\r\ndebug2: set\_control\_persist\_exit\_time: schedule exit in 60 seconds\r\ndebug1: multiplexing control connection\r\ndebug2: fd 5 setting O\_NONBLOCK\r\ndebug3: fd 5 is O\_NONBLOCK\r\ndebug1: channel 1: new [mux-control]\r\ndebug3: channel\_post\_mux\_listener: new mux channel 1 fd 5\r\ndebug3: mux\_master\_read\_cb: channel 1: hello sent\r\ndebug2: set\_control\_persist\_exit\_time: cancel scheduled exit\r\ndebug3: mux\_master\_read\_cb: channel 1 packet type 0x00000001 len 4\r\ndebug2: process\_mux\_master\_hello: channel 1 slave version 4\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\_master\_read\_cb: channel 1 packet type 0x10000004 len 4\r\ndebug2: process\_mux\_alive\_check: channel 1: alive check\r\ndebug3: mux\_client\_request\_alive: done pid = 5880\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug3: mux\_master\_read\_cb: channel 1 packet type 0x10000002 len 91\r\ndebug2: process\_mux\_new\_session: channel 1: request tty 0, X 0, agent 0, subsys 0, term “xterm”, cmd “/bin/sh -c 'echo ~ && sleep 0'”, env 1\r\ndebug3: process\_mux\_new\_session: got fds stdin 6, stdout 7, stderr 8\r\ndebug2: fd 7 setting O\_NONBLOCK\r\ndebug2: fd 8 setting O\_NONBLOCK\r\ndebug1: channel 2: new [client-session]\r\ndebug2: process\_mux\_new\_session: channel\_new: 2 linked to control channel 1\r\ndebug2: channel 2: send open\r\ndebug3: send packet: type 90\r\ndebug3: receive packet: type 80\r\ndebug1: client\_input\_global\_request: rtype [hostkeys-00@openssh.com](mailto:hostkeys-00@openssh.com) want\_reply 0\r\ndebug3: receive packet: type 91\r\ndebug2: callback start\r\ndebug2: client\_session2\_setup: id 2\r\ndebug1: Sending environment.\r\ndebug1: Sending env LANG = en\_US.UTF-8\r\ndebug2: channel 2: request env confirm 0\r\ndebug3: send packet: type 98\r\ndebug1: Sending command: /bin/sh -c 'echo ~ && sleep 0'\r\ndebug2: channel 2: request exec confirm 1\r\ndebug3: send packet: type 98\r\ndebug3: mux\_session\_confirm: sending success reply\r\ndebug2: callback done\r\ndebug2: channel 2: open confirm rwindow 0 rmax 32768\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug2: channel 2: rcvd adjust 2097152\r\ndebug3: receive packet: type 99\r\ndebug2: channel\_input\_status\_confirm: type 99 id 2\r\ndebug2: exec request accepted on channel 2\r\ndebug3: receive packet: type 98\r\ndebug1: client\_input\_channel\_req: channel 2 rtype exit-status reply 0\r\ndebug3: mux\_exit\_message: channel 2: exit message, exitval 0\r\ndebug3: receive packet: type 98\r\ndebug1: client\_input\_channel\_req: channel 2 rtype [eow@openssh.com](mailto:eow@openssh.com) reply 0\r\ndebug2: channel 2: rcvd eow\r\ndebug2: channel 2: close\_read\r\ndebug2: channel 2: input open → closed\r\ndebug3: receive packet: type 96\r\ndebug2: channel 2: rcvd eof\r\ndebug2: channel 2: output open → drain\r\ndebug2: channel 2: obuf empty\r\ndebug2: channel 2: close\_write\r\ndebug2: channel 2: output drain → closed\r\ndebug3: receive packet: type 97\r\ndebug2: channel 2: rcvd close\r\ndebug3: channel 2: will not send data after close\r\ndebug2: channel 2: send close\r\ndebug3: send packet: type 97\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: gc: notify user\r\ndebug3: mux\_master\_session\_cleanup\_cb: entering for channel 2\r\ndebug2: channel 1: rcvd close\r\ndebug2: channel 1: output open → drain\r\ndebug2: channel 1: close\_read\r\ndebug2: channel 1: input open → closed\r\ndebug2: channel 2: gc: user detached\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: garbage collecting\r\ndebug1: channel 2: free: client-session, nchannels 3\r\ndebug3: channel 2: status: The following connections are open:\r\n #1 mux-control (t16 r-1 i3/0 o1/16 fd 5/5 cc -1)\r\n #2 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)\r\n\r\ndebug2: channel 1: obuf empty\r\ndebug2: channel 1: close\_write\r\ndebug2: channel 1: output drain → closed\r\ndebug2: channel 1: is dead (local)\r\ndebug2: channel 1: gc: notify user\r\ndebug3: mux\_master\_control\_cleanup\_cb: entering for channel 1\r\ndebug2: channel 1: gc: user detached\r\ndebug2: channel 1: is dead (local)\r\ndebug2: channel 1: garbage collecting\r\ndebug1: channel 1: free: mux-control, nchannels 2\r\ndebug3: channel 1: status: The following connections are open:\r\n #1 mux-control (t16 r-1 i3/0 o3/0 fd 5/5 cc -1)\r\n\r\ndebug2: set\_control\_persist\_exit\_time: schedule exit in 60 seconds\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)  
 ESTABLISH SSH CONNECTION FOR USER: None  
 SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
 SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
 SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
 SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4)  
 SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4 TargetHost '/bin/sh -c '”‘"’( umask 77 && mkdir -p “`echo /home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274`” && echo ansible-tmp-1546436777.8-151172896470274=“`echo /home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274`” ) && sleep 0’“'”‘’  
 (0, ‘ansible-tmp-1546436777.8-151172896470274=/home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274\n’, ‘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 = 5880\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 0\r\n’)  
 PUT /tmp/tmpsdH3QZ TO /home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274/command.py  
 SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
 SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
 SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
 SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4)  
 SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4 ‘[TargetHost]’  
 (0, ‘sftp\> put /tmp/tmpsdH3QZ /home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274/command.py\n’, ‘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 = 5880\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension “[posix-rename@openssh.com](mailto:posix-rename@openssh.com)” revision 1\r\ndebug2: Server supports extension “[statvfs@openssh.com](mailto:statvfs@openssh.com)” revision 2\r\ndebug2: Server supports extension “[fstatvfs@openssh.com](mailto:fstatvfs@openssh.com)” revision 2\r\ndebug2: Server supports extension “[hardlink@openssh.com](mailto:hardlink@openssh.com)” revision 1\r\ndebug2: Server supports extension “[fsync@openssh.com](mailto:fsync@openssh.com)” revision 1\r\ndebug3: Sent message fd 5 T:16 I:1\r\ndebug3: SSH\_FXP\_REALPATH . → /home/MyAccunt size 0\r\ndebug3: Looking up /tmp/tmpsdH3QZ\r\ndebug3: Sent message fd 5 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn't stat remote file: No such file or directory\r\ndebug3: Sent message SSH2\_FXP\_OPEN I:3 P:/home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274/command.py\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:6 O:65536 S:1260\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 6 1260 bytes at 65536\r\ndebug3: Sent message SSH2\_FXP\_CLOSE I:4\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)  
 ESTABLISH SSH CONNECTION FOR USER: None  
 SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
 SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
 SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
 SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4)  
 SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4 TargetHost ‘/bin/sh -c ‘"’“‘chmod u+x /home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274/ /home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274/command.py && sleep 0’”’“‘’  
 (0, ‘’, ‘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 = 5880\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 0\r\n’)  
 ESTABLISH SSH CONNECTION FOR USER: None  
 SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
 SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
 SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
 SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4)  
 SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/MyAccunt/.ansible/cp/90b7a51bf4 -tt TargetHost '/bin/sh -c '”‘“'sudo -H -S -n -u root /bin/sh -c '”’“'”‘"’“'”‘"’“‘echo BECOME-SUCCESS-yloswjdxocxkzoanywslvrqvhgymlidx; /usr/bin/python /home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274/command.py; rm -rf “/home/MyAccunt/.ansible/tmp/ansible-tmp-1546436777.8-151172896470274/” \> /dev/null 2\>&1’”‘"’“'”‘"’“'”‘"’ && sleep 0’“'”‘’  
 (1, ‘sudo: a password is required\r\n’, ‘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 = 5880\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 1\r\nShared connection to TargetHost closed.\r\n’)  
TargetHost | FAILED! =\> {  
“changed”: false,  
“module\_stderr”: “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 = 5880\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 1\r\nShared connection to TargetHost closed.\r\n”,  
“module\_stdout”: “sudo: a password is required\r\n”,  
“msg”: “MODULE FAILURE”,  
“rc”: 1  
}

`

Any ideas why ansible with become fails for CentOS 7 clients?

TIA

---

<div class="post-metadata">

**Author:** ![jegansignup](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jegansignup](https://forum.ansible.com/u/jegansignup)\
**Post date:** [January 7, 2019, 2:37pm UTC](https://forum.ansible.com/t/become-not-working-on-centos-7-hosts/29352/2 "2019-01-07T14:37:09Z")

</div>

I have tried the same on Centos 7 (remote/target server) and ansible version is 2.6.5

[root@VM-100905129 ~]# $ ansible --version  
ansible 2.6.5  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/site-packages/ansible  
executable location = /usr/bin/ansible  
python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

**Python version on remote server**

[root@VM-100905126 ~]# python --version  
Python 2.7.5

**Ansible command results**

[root@VM-100905129 ~]# ansible all -i 10.149.193.26, -a “echo helo” -become -vvvvv  
ansible 2.6.5  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/site-packages/ansible  
executable location = /usr/bin/ansible  
python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]  
Using /etc/ansible/ansible.cfg as config file  
setting up inventory plugins  
Parsed 10.149.193.26, inventory source with host\_list plugin  
Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/minimal.pyc  
META: ran handlers  
\<10.149.193.26\> ESTABLISH SSH CONNECTION FOR USER: None  
\<10.149.193.26\> SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
\<10.149.193.26\> SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
\<10.149.193.26\> SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
\<10.149.193.26\> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/7eb2f1a4e7)  
\<10.149.193.26\> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/7eb2f1a4e7 10.149.193.26 ‘/bin/sh -c ‘"’“‘echo ~ && sleep 0’”’“‘’  
\<10.149.193.26\> (0, ‘/root\n’, ‘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 = 27669\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 0\r\n’)  
\<10.149.193.26\> ESTABLISH SSH CONNECTION FOR USER: None  
\<10.149.193.26\> SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
\<10.149.193.26\> SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
\<10.149.193.26\> SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
\<10.149.193.26\> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/7eb2f1a4e7)  
\<10.149.193.26\> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/7eb2f1a4e7 10.149.193.26 '/bin/sh -c '”‘"’( umask 77 && mkdir -p “`echo /root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660`” && echo ansible-tmp-1546871467.08-51351557142660=“`echo /root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660`” ) && sleep 0’“'”‘’  
\<10.149.193.26\> (0, ‘ansible-tmp-1546871467.08-51351557142660=/root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660\n’, ‘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 = 27669\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 0\r\n’)  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/basic.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/\_text.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/parsing/convert\_bool.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/parsing/ **init**.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/pycompat24.py  
Using module\_utils file /usr/lib/python2.7/site-packages/ansible/module\_utils/six/ **init**.py  
Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py  
\<10.149.193.26\> PUT /root/.ansible/tmp/ansible-local-27716CQm7qh/tmp5M2cRT TO /root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660/command.py  
\<10.149.193.26\> SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
\<10.149.193.26\> SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
\<10.149.193.26\> SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
\<10.149.193.26\> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/7eb2f1a4e7)  
\<10.149.193.26\> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/7eb2f1a4e7 ‘[10.149.193.26]’  
\<10.149.193.26\> (0, ‘sftp\> put /root/.ansible/tmp/ansible-local-27716CQm7qh/tmp5M2cRT /root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660/command.py\n’, ‘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 = 27669\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension “[posix-rename@openssh.com](mailto:posix-rename@openssh.com)” revision 1\r\ndebug2: Server supports extension “[statvfs@openssh.com](mailto:statvfs@openssh.com)” revision 2\r\ndebug2: Server supports extension “[fstatvfs@openssh.com](mailto:fstatvfs@openssh.com)” revision 2\r\ndebug2: Server supports extension “[hardlink@openssh.com](mailto:hardlink@openssh.com)” revision 1\r\ndebug3: Sent message fd 5 T:16 I:1\r\ndebug3: SSH\_FXP\_REALPATH . → /root size 0\r\ndebug3: Looking up /root/.ansible/tmp/ansible-local-27716CQm7qh/tmp5M2cRT\r\ndebug3: Sent message fd 5 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn't stat remote file: No such file or directory\r\ndebug3: Sent message SSH2\_FXP\_OPEN I:3 P:/root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660/command.py\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:6 O:65536 S:3675\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 6 3675 bytes at 65536\r\ndebug3: Sent message SSH2\_FXP\_CLOSE I:4\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)  
\<10.149.193.26\> ESTABLISH SSH CONNECTION FOR USER: None  
\<10.149.193.26\> SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
\<10.149.193.26\> SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
\<10.149.193.26\> SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
\<10.149.193.26\> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/7eb2f1a4e7)  
\<10.149.193.26\> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/7eb2f1a4e7 10.149.193.26 ‘/bin/sh -c ‘"’“‘chmod u+x /root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660/ /root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660/command.py && sleep 0’”’“‘’  
\<10.149.193.26\> (0, ‘’, ‘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 = 27669\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 0\r\n’)  
\<10.149.193.26\> ESTABLISH SSH CONNECTION FOR USER: None  
\<10.149.193.26\> SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
\<10.149.193.26\> SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
\<10.149.193.26\> SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
\<10.149.193.26\> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/7eb2f1a4e7)  
\<10.149.193.26\> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/7eb2f1a4e7 -tt 10.149.193.26 '/bin/sh -c '”‘“'sudo -H -S -n -u root /bin/sh -c '”’“'”‘"’“'”‘"’“‘echo BECOME-SUCCESS-jegqowyhulaqypgqqatvmsdaxaqohyek; /usr/bin/python /root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660/command.py’”‘"’“'”‘"’“'”‘"’ && sleep 0’“'”‘’  
Escalation succeeded  
\<10.149.193.26\> (0, ‘\r\n{“changed”: true, “end”: “2019-01-07 09:31:07.582939”, “stdout”: “helo”, “cmd”: [“echo”, “helo”], “rc”: 0, “start”: “2019-01-07 09:31:07.580362”, “stderr”: “”, “delta”: “0:00:00.002577”, “invocation”: {“module\_args”: {“warn”: true, “executable”: null, “\_uses\_shell”: false, “\_raw\_params”: “echo helo”, “removes”: null, “argv”: null, “creates”: null, “chdir”: null, “stdin”: null}}}\r\n’, ‘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 = 27669\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 0\r\nShared connection to 10.149.193.26 closed.\r\n’)  
\<10.149.193.26\> ESTABLISH SSH CONNECTION FOR USER: None  
\<10.149.193.26\> SSH: ansible.cfg set ssh\_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)  
\<10.149.193.26\> SSH: ansible\_password/ansible\_ssh\_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)  
\<10.149.193.26\> SSH: ANSIBLE\_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)  
\<10.149.193.26\> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/7eb2f1a4e7)  
\<10.149.193.26\> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/7eb2f1a4e7 10.149.193.26 ‘/bin/sh -c ‘"’“‘rm -f -r /root/.ansible/tmp/ansible-tmp-1546871467.08-51351557142660/ \> /dev/null 2\>&1 && sleep 0’”’"‘’  
\<10.149.193.26\> (0, ‘’, ‘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 = 27669\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 0\r\n’)  
10.149.193.26 | SUCCESS | rc=0 \>\>  
helo

META: ran handlers  
META: ran handlers

---

<div class="post-metadata">

**Author:** ![eric.dunn](https://avatars.discourse-cdn.com/v4/letter/e/c2a13f/32.png) [@eric.dunn](https://forum.ansible.com/u/eric.dunn)\
**Post date:** [January 7, 2019, 3:52pm UTC](https://forum.ansible.com/t/become-not-working-on-centos-7-hosts/29352/3 "2019-01-07T15:52:54Z")

</div>

Is it an issue with the ssh keys?

---

<div class="post-metadata">

**Author:** ![cassell](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cassell](https://forum.ansible.com/u/cassell)\
**Post date:** [January 7, 2019, 4:07pm UTC](https://forum.ansible.com/t/become-not-working-on-centos-7-hosts/29352/4 "2019-01-07T16:07:14Z")

</div>

> I've got ansible setup in a centos 6 & 7 environment. The Centos 6 hosts  
> all work fine. The centos 7 hosts work, but I cannot use "become" with  
> centos 7. It works with Centos 6, and non-root commands work with centos  
> 7. Here is a snippet from the debug log

[...]

> [MyAccunt@util07 ~]$ ansible TargetHost -a "echo hello" --  
> Received  
> exit status from master 1\r\nShared connection to TargetHost closed.\r  
> \n",  
> &nbsp;&nbsp;&nbsp;"module\_stdout": "sudo: a password is required\r\n",  
> &nbsp;&nbsp;&nbsp;"msg": "MODULE FAILURE",  
> &nbsp;&nbsp;&nbsp;"rc": 1  
> }

It's telling you here that sudo is configured to require a password, but none is being passed. Pass -K on the ansible command line to have ansible prompt you for it.

> Any ideas why ansible with become fails for CentOS 7 clients?
> 
> TIA

V/r,  
James Cassell

---

<div class="post-metadata">

**Author:** ![jegansignup](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jegansignup](https://forum.ansible.com/u/jegansignup)\
**Post date:** [January 7, 2019, 4:45pm UTC](https://forum.ansible.com/t/become-not-working-on-centos-7-hosts/29352/5 "2019-01-07T16:45:38Z")

</div>

I have gone through your playbook I don’t see any issue in that. If you feel issue with ssh keys try to run ping command using ansible command , If it fails then issue with ssh key. One more thing is pls set ‘mode’ (600) for authorized\_keys file on target host while doing lineinfile action.
