Using ssh X11 tunnel through a bastion host to connect to a database server


Hi,

I succeeded running Oracle dbca, xclock & virt-viewer using Bastion over VPN (with root) 😊

Theoretical Steps:

First, connect to machine B and forward [localPort] to C:22 through B
A$ ssh -L [localPort]:C:22 B
Next, connect to C from A through this newly-created tunnel using [localPort], forwarding X11
A$ ssh -X -p [localPort] localhost
Now we can run X11 programs on C and have them display on A
C$ xclock
[localPort] can be any port that you are not already listening to on A, I often use 2222 for simplicity.
X11Forwarding should be enabled on server C
AllowTcpForwarding should be enabled on server B

Actual Steps

First, connect to machine B and forward [localPort] to C:22 through B
A$ ssh -L [localPort]:C:22 B
Next, connect to C from A through this newly-created tunnel using [localPort], forwarding X11
From A using putty to localhost using [localPort] enable X11 forwarding to localhost:0.0
Now we can run X11 programs on C and have them display on A
C using putty:
C$ export DISPLAY=127.0.0.1:10.0
C$ xclock

Comments

Popular posts from this blog

Data Guard - Changing IP Addresses

Install Oracle Internet Directory (OID) in Standalone mode

Fixing & Registering ORACLE_HOMES in Central Inventory