# ssh connection doesn't work

**URL:** <https://forum.ansible.com/t/ssh-connection-doesnt-work/26655>\
**Category:** Ansible Project\
**Created:** [February 4, 2018, 12:52pm UTC](https://forum.ansible.com/t/ssh-connection-doesnt-work/26655 "2018-02-04T12:52:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan.recly](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jonathan.recly](https://forum.ansible.com/u/jonathan.recly)\
**Post date:** [February 4, 2018, 12:52pm UTC](https://forum.ansible.com/t/ssh-connection-doesnt-work/26655/1 "2018-02-04T12:52:54Z")

</div>

Hi everybody,

I have some problems to use ansible.

I use ansible version 2.4.3.0 i

I testing just one host with IP and port (I have port fowarding).  
I copying ssh pub key (ssh-copy-id).  
I try to install Git on the target serveur.

tasks:

- name: Installation de Git  
apt: name=git update\_cache=yes

When I lauch ansible (ansible-playbook -i hosts playbook.yml -vvvvvvvv), I have this message error :

OpenSSH\_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: 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 = 5417\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 165.169.240.98 closed.\r\n",  
“module\_stdout”: “/bin/sh: 1: /usr/bin/python: not found\r\n”

But if I lauch ansible ssh command in the terminal (just copy and paste ansible ssh command : ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o Port=2211 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/jrecly/.ansible/cp/d29cd310c0 -tt 165.169.240.98), connection wil be establish normaly

here the result of the -vvvvv ansible-playbook command

---

<div class="post-metadata">

**Author:** ![Varun\_Chopra](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@Varun\_Chopra](https://forum.ansible.com/u/Varun_Chopra)\
**Post date:** [February 4, 2018, 1:22pm UTC](https://forum.ansible.com/t/ssh-connection-doesnt-work/26655/2 "2018-02-04T13:22:51Z")

</div>

You need to have Python installed on the managed host.

---

<div class="post-metadata">

**Author:** ![jonathan.recly](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jonathan.recly](https://forum.ansible.com/u/jonathan.recly)\
**Post date:** [February 4, 2018, 1:38pm UTC](https://forum.ansible.com/t/ssh-connection-doesnt-work/26655/3 "2018-02-04T13:38:52Z")

</div>

really ? just that ?

I try with python installed in the managed machine … And you know what ? It’s work 🙂

Thanks very much for your help. I pass two day to search on internet solution, and you save me with this simply response.

Have a good day and thanks again.
