# SSH error on Centos - ansible 1.9.2

**URL:** <https://forum.ansible.com/t/ssh-error-on-centos-ansible-1-9-2/19113>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [August 26, 2015, 3:48am UTC](https://forum.ansible.com/t/ssh-error-on-centos-ansible-1-9-2/19113 "2015-08-26T03:48:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Bubb](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Michael\_Bubb](https://forum.ansible.com/u/Michael_Bubb)\
**Post date:** [August 26, 2015, 3:48am UTC](https://forum.ansible.com/t/ssh-error-on-centos-ansible-1-9-2/19113/1 "2015-08-26T03:48:30Z")

</div>

Hello

I recently upgraded ssh and broke my Ansible setup.

ssh to the target works using the same creds:

# ssh -i /home/ansible\_user/.ssh/pk\_ansible\_user\_rsa [ansible\_user@apps05.somedomain.com](mailto:ansible_user@apps05.somedomain.com)

Last login: Tue Aug 25 23:07:38 2015 from 108.x.x.x  
[ansible\_user@apps05 ~]$  
[ansible\_user@apps05 ~]$ logout  
Connection to [apps05.somedomain.com](http://apps05.somedomain.com) closed.

But when I attempt

ansible or ansible-playbook I get the following:

# ansible-playbook -vvvv /etc/ansible/ansible-modules/iptables\_add\_rules.yml -s -C -l [apps05.somedomain.com](http://apps05.somedomain.com)

PLAY [Iptables setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\<10.80.224.12\> ESTABLISH CONNECTION FOR USER: ansible\_user  
\<10.80.224.12\> REMOTE\_MODULE setup CHECKMODE=True  
\<10.80.224.12\> EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking no -o ControlPath=“/root/.ansible/cp/ansible-ssh-%h-%p-%r” -o Port=22 -o IdentityFile=“/home/ansible\_user/.ssh/pk\_ansible\_user\_rsa” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible\_user -o ConnectTimeout=10 10.80.224.12 /bin/sh -c ‘sudo -k && sudo -H -S -p “[sudo via ansible, key=xxxxxxxxxx] password: " -u root /bin/sh -c '”’“‘echo BECOME-SUCCESS-xxxxxxxxxxxxxxxxg; LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python’”‘"’’  
fatal: [[apps05.somedomain.com](http://apps05.somedomain.com)] =\> SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh

my ansible.cfg looks like:

[defaults]  
hostfile = /etc/ansible/hosts  
library = /usr/share/ansible  
remote\_tmp = $HOME/.ansible/tmp  
pattern = \*  
forks = 5  
poll\_interval = 15  
sudo\_user = root  
transport = smart  
remote\_port = 22  
roles\_path = /etc/ansible/ansible-modules/roles:/etc/ansible/ansible-galaxy  
sudo\_exe = sudo  
timeout = 10  
remote\_user = ansible\_user  
log\_path = /var/log/ansible.log  
private\_key\_file = /home/ansible\_user/.ssh/pk\_ansible\_user\_rsa  
ansible\_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}  
action\_plugins = /usr/share/ansible\_plugins/action\_plugins  
callback\_plugins = /usr/share/ansible\_plugins/callback\_plugins  
connection\_plugins = /usr/share/ansible\_plugins/connection\_plugins  
lookup\_plugins = /usr/share/ansible\_plugins/lookup\_plugins  
vars\_plugins = /usr/share/ansible\_plugins/vars\_plugins  
filter\_plugins = /usr/share/ansible\_plugins/filter\_plugins  
[paramiko\_connection]  
[ssh\_connection]  
ssh\_args = -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking no  
pipelining = True  
scp\_if\_ssh = True  
[accelerate]  
accelerate\_port = 5099  
accelerate\_timeout = 30  
accelerate\_connect\_timeout = 5.0

I am at a loss…

yrs

Michael

---

<div class="post-metadata">

**Author:** ![Michael\_Bubb](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Michael\_Bubb](https://forum.ansible.com/u/Michael_Bubb)\
**Post date:** [August 26, 2015, 1:06pm UTC](https://forum.ansible.com/t/ssh-error-on-centos-ansible-1-9-2/19113/2 "2015-08-26T13:06:17Z")

</div>

I hve ssh-agent running and tested with it:

[root@ansible-wdc-1 ~]# ssh-add -l  
2048 54::xxxxxxxxxx /home/ansible\_user/.ssh/pk\_ansible\_user\_rsa (RSA)  
[root@ansible-wdc-1 ~]# ssh [ansible\_user@apps06.sampledom.com](mailto:ansible_user@apps06.sampledom.com)  
Last login: Wed Aug 26 08:57:13 2015 from 108.168.174.114  
[ansible\_user@apps06 ~]$

But still cannot run my playbooks. Or ansible oneliners:

[root@ansible-wdc-1 ~]# ansible -vvv all -m ping -l apps06\*  
\<10.80.224.6\> ESTABLISH CONNECTION FOR USER: ansible\_user  
\<10.80.224.6\> REMOTE\_MODULE ping  
\<10.80.224.6\> EXEC ssh -C -v -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking no -o ControlPath=“/root/.ansible/cp/ansible-ssh-%h-%p-%r” -o Port=22 -o IdentityFile=“/home/ansible\_user/.ssh/pk\_ansible\_user\_rsa” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible\_user -o ConnectTimeout=10 10.80.224.6 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python’  
[apps06.sampledom.com](http://apps06.sampledom.com) | FAILED =\> SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh

The long story is that I inherited this box and realize now there was some kind of special sauce to get this to work. My overall goal is to tease the Ansible and Jenkins setup off of this box (which does about 30 other things) and give the Ansible/jenkins/ git procs a new home.

For now I need to get this to work again on this less than optimal system.

My underlying ssh works fine but the way I have Ansible setup I am not able to connect over ssh.

What should I read beyond  
[http://www.ansible.com/how-ansible-works](http://www.ansible.com/how-ansible-works)

to get Ansible to work with underlying ssh?

thank you

Michael

---

<div class="post-metadata">

**Author:** ![Jyoti\_Ranjan](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@Jyoti\_Ranjan](https://forum.ansible.com/u/Jyoti_Ranjan)\
**Post date:** [September 20, 2016, 4:37pm UTC](https://forum.ansible.com/t/ssh-error-on-centos-ansible-1-9-2/19113/3 "2016-09-20T16:37:35Z")

</div>

Hi Michael,

Did this issue got resolved for you? I am also seeing similar issue but unable to find clue.

Regards,  
Jyoti Ranjna
