Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!



Port Forward via Bastion in 1 command?

By cjeddie2003 ·
I'm looking for a way to port forward from my local machine via a bastion host to my actual destination machine in a single command. Ideally I can't use authorized keys and must use keyboard-interactive password authentication the entire way.

A command I tried sort of gets 50% of the way there but I'm hoping someone knows a better or improved method than below:

ssh -n -T -L [local_port]:localhost:[bastion_port] user1@bastion_host 'ssh -o StrictHostKeyChecking=no -n -T -L [bastion_port]:localhost:[remote_port] user1@remote_host'

(the above ssh's port forwarding to the bastion, then uses the same ssh session to launch a second ssh session to the target host. The problem is that it doesn't prompt for the second password and just prints

"Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password,keyboard-interactive)."

Any ideas?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums