My normal flow is like:
ssh jumphost sudo -iHu jump_user ssh target_user@targethost Do some task
How to do this using ProxyCommand? I have tried:
ssh target_user@target_host -o ProxyCommand="ssh jumphost 'sudo -iHu jump_user' nc -w 120 %h %p"
But it's asking password for
target_user as user is not changing to
jump_host. How to do it? My final aim is to use this as
ansible_ssh_common_args so I can run tasks on target server.