# ssh error connection time out

**URL:** <https://forum.ansible.com/t/ssh-error-connection-time-out/20071>\
**Category:** Ansible Project\
**Created:** [December 23, 2015, 2:50pm UTC](https://forum.ansible.com/t/ssh-error-connection-time-out/20071 "2015-12-23T14:50:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_Ranabhatt](https://avatars.discourse-cdn.com/v4/letter/v/aca169/32.png) [@Vikram\_Ranabhatt](https://forum.ansible.com/u/Vikram_Ranabhatt)\
**Post date:** [December 23, 2015, 2:50pm UTC](https://forum.ansible.com/t/ssh-error-connection-time-out/20071/1 "2015-12-23T14:50:43Z")

</div>

I am using ansible 1.9.3

Manuall ssh to the machine some time work and some time not work.But regardless of manuall ssh login…i am getting this error.

PLAY [licproxy] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

\<10.32.1.40\> ESTABLISH CONNECTION FOR USER: my-user

\<10.32.1.40\> REMOTE\_MODULE setup

\<10.32.1.40\> EXEC ssh -C -tt -vvv -o StrictHostKeyChecking=no -o IdentityFile=“/opt/apps/installer/tenant-dev29/ssh/admin-key-vmsdev29” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=cloud-user -o ConnectTimeout=10 10.32.1.40 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1450797442.33-90087292637238 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1450797442.33-90087292637238 && echo $HOME/.ansible/tmp/ansible-tmp-1450797442.33-90087292637238’

EXEC previous known host file not found for 10.32.1.40

fatal: [10.32.1.40] =\> SSH Error: ssh: connect to host 10.32.1.40 port 22: Connection refused

while connecting to 10.32.1.40:22

It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.

TASK: [Install tinyproxy] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

FATAL: no hosts matched or all hosts have already failed – aborting

.yml file

```auto
---
- hosts: myproxy
  user: cloud-user  
  sudo: yes
  tasks:

  - name: Install tinyproxy
    apt: name=tinyproxy state=present update_cache=yes

  - name: Install bind9
    apt: name=bind9 state=present update_cache=yes force=yes    

```

---

<div class="post-metadata">

**Author:** ![Cody\_McCoder](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@Cody\_McCoder](https://forum.ansible.com/u/Cody_McCoder)\
**Post date:** [January 19, 2016, 7:12pm UTC](https://forum.ansible.com/t/ssh-error-connection-time-out/20071/2 "2016-01-19T19:12:17Z")

</div>

I believe I know the generic answer to your question from reading other posts:  
~/.ssh/known\_hosts must exist on the target machine for the user you are ssh as (also make sure you have the correct perms on this file and the .ssh directory)

The part that I would like to understand is WHY this file is required. If the ssh to the machine was successful and strict host key checking is off then what benefit is the file? This file will never exist on my freshly imaged machines and I’d rather not have to add a hack to create it for ansible. Any way to turn this off?
