Skip to content

Ssh tunnel proxy traffic and bastion

wordpress meta

title: 'SSH Tunnel Proxy Traffic and Bastion'
date: '2018-07-09T08:28:29-05:00'
status: publish
permalink: /ssh-tunnel-proxy-traffic-and-bastion
author: admin
excerpt: ''
type: post
id: 1225
category:
    - SSH
tag: []
post_format: []

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