I have to use ssh tunnel to manage my hosts.
- create ssh tunnel “ssh -L 8082:: root@”
- 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”, i got success too.
I don’t know why…
Can anyone help me to solve this problem?