Question

Locked

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.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Networks Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums