# One Trouble! -- ansible connect to remote host

**URL:** <https://forum.ansible.com/t/one-trouble-ansible-connect-to-remote-host/22814>\
**Category:** Ansible Developer\
**Created:** [October 18, 2016, 3:36am UTC](https://forum.ansible.com/t/one-trouble-ansible-connect-to-remote-host/22814 "2016-10-18T03:36:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user12](https://avatars.discourse-cdn.com/v4/letter/u/e0b2c6/32.png) [@user12](https://forum.ansible.com/u/user12)\
**Post date:** [October 18, 2016, 3:36am UTC](https://forum.ansible.com/t/one-trouble-ansible-connect-to-remote-host/22814/1 "2016-10-18T03:36:11Z")

</div>

In my IT infrastructure , ansible can not connet to remote host by ssh directly,between server and remote has a FM(Fortress Machine),how can I connet to remote with zhe FM?

---

<div class="post-metadata">

**Author:** ![Martin\_Schmidt](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@Martin\_Schmidt](https://forum.ansible.com/u/Martin_Schmidt)\
**Post date:** [October 18, 2016, 5:35am UTC](https://forum.ansible.com/t/one-trouble-ansible-connect-to-remote-host/22814/2 "2016-10-18T05:35:42Z")

</div>

Hi,  
you can use the ssh proxycommand option:

$ cat ~/.ssh/config

&nbsp;&nbsp;&nbsp;Host host1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User user1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProxyCommand ssh FM\_user@FM -W %h:%p

Best,  
Martin

---

<div class="post-metadata">

**Author:** ![user12](https://avatars.discourse-cdn.com/v4/letter/u/e0b2c6/32.png) [@user12](https://forum.ansible.com/u/user12)\
**Post date:** [October 18, 2016, 10:12am UTC](https://forum.ansible.com/t/one-trouble-ansible-connect-to-remote-host/22814/3 "2016-10-18T10:12:43Z")

</div>

I try it, and exceute:  
ansible 192.168.170.197 -m setup

but looks this:

[![](https://lh3.googleusercontent.com/-s8Eo1OcWusw/WAX1JzurTVI/AAAAAAAAABE/Xmh0_baaef8uL5Rd6n8ZJ7QKf_bArnCkwCLcB/s320/2016-10-18_180907.png)](https://lh3.googleusercontent.com/-s8Eo1OcWusw/WAX1JzurTVI/AAAAAAAAABE/Xmh0_baaef8uL5Rd6n8ZJ7QKf_bArnCkwCLcB/s1600/2016-10-18_180907.png)

then ,input anything will be error always

在 2016年10月18日星期二 UTC+8下午1:35:48，Martin Schmidt写道：
