Riaan's SysAdmin Blog

My tips, howtos, gotchas, snippets and stuff. Use at your own risk!

SSH

SSH Tunnel Proxy Traffic and Bastion

Sometimes you need to test a protocol and only have SSH access through a bastion host. You can display X back for example firefox or you can route traffic through a SSH tunnel. Here is a couple examples:

1. Display back should be fairly common and I don't need to elaborate much. Use -X and connect to the host with firefox.

$ ssh -X -F M-config ociserver1
Last login: Mon Jul  9 07:46:39 2018 from desk01
$ firefox 

URL works http://ebs.domain1.com:8000/OA_HTML/OA.jsp?OAFunc=OASIMPLEHOMEPAGE

2. SSH Tunnel

$ ssh -L8000:10.35.6.4:8000 -i oci-M opc@pub.lic.ip.address
Last login: Mon Jul  9 07:36:01 2018 from c-desktop

$ grep ebs /etc/hosts
127.0.0.1 ebs.domain1.com

URL works http://ebs.domain1.com:8000/OA_HTML/OA.jsp?OAFunc=OASIMPLEHOMEPAGE

admin

Bio Info for Riaan