Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month, online, via Jitsi Meet.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] SSH port forwarding through middleman (bastion host)



Oh, ssh has so many features, that can be obscure.

If I understand, I think this will help.

Say you:

   ssh -L 3456:foo.com:22 bar.com

Type in the password (or supply a key) for bar.com. You will get a 
prompt from bar.com

Then:

  ssh -p 3456 localhost

Type in the password (or supply a key) for foo.com. You will get a 
prompt from foo.com.

To keep your fingerprints straight might want instead to do:

   ssh -X -o UserKnownHostsFile=/home/kentborg/.ssh/known_foo -p 3456 
localhost


And you can do this with other port, put in more than one -L thingie, to 
forward more ports. Recently I needed to get to a wifi box in my 
mother-in-law's house so I did and ssh with something like "-L 
8888:10.0.0.32:80", and then I could point my browser at localhost:8888 
and hit that box.


-kb, the Kent who loves ssh, but who also persists in using (good, not 
recycled) passwords.



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org