# With ssh tunnel, can not -m ping remote host successful

**URL:** <https://forum.ansible.com/t/with-ssh-tunnel-can-not-m-ping-remote-host-successful/17239>\
**Category:** Ansible Project\
**Created:** [January 12, 2015, 9:48am UTC](https://forum.ansible.com/t/with-ssh-tunnel-can-not-m-ping-remote-host-successful/17239 "2015-01-12T09:48:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlu.xzp](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@jlu.xzp](https://forum.ansible.com/u/jlu.xzp)\
**Post date:** [January 12, 2015, 9:48am UTC](https://forum.ansible.com/t/with-ssh-tunnel-can-not-m-ping-remote-host-successful/17239/1 "2015-01-12T09:48:42Z")

</div>

I have to use ssh tunnel to manage my hosts.

1. create ssh tunnel “ssh -L 8082:: root@”
2. edit host cfg  
[servers]  
server ansible\_ssh\_port=8082 ansible\_ssh\_host=127.0.0.1 ansible\_ssh\_user=root ansible\_ssh\_pass=xxxx

then use “ansible servers -m ping”

I got “FAILED =\> Authentication failure.”

But if i delete ansible\_ssh\_user, then use “ansible severs -m ping -k” and use password “xxxx”, i got success.

And if i use “sshpass -p xxxx ssh -p 8082 [root@127.0.0.1](mailto:root@127.0.0.1)”, i got success too.

I don’t know why…

Can anyone help me to solve this problem?
