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

8 views
Skip to first unread message

jlu...@gmail.com

unread,
Jan 12, 2015, 4:48:43 AM1/12/15
to ansible...@googlegroups.com
I have to use ssh tunnel to manage my hosts.

1. create ssh tunnel   "ssh -L 8082:<internal ip>:<remote port>  root@<remote ip>"
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 ro...@127.0.0.1", i got success too.

I don't know why...

Can anyone help me to solve this problem?
Reply all
Reply to author
Forward
0 new messages