Monday, September 3, 2007

SSH Tunneling

You have a trouble when you got your localhost (your computer) has no route to XWindows public server (linux, unix base). Your computer only has route to one of computer in the network which has route to public server that you want.
Somebody that ever install Oracle via remote connection will find this problem.

Example:
Your local computer is "localhost"
Your server #1 is private IP "10.80.123.203"
Your server #2 is public IP "203.13x.xxx.xx"

Localhost ----- Server #1 ------- Server #2

|______ XWindows Application _______|
|___________ No Route ______________|


How to get connection via SSH so you can remote your public server include the XWindows application ?

Here are the steps must be done :

SSH tunneling from 10.80.123.203 to public IP 202.13x.xxx.xx
# ssh konang@10.80.123.203 -p 2350
# ssh -L 2211:127.0.0.1:2350 konang@203.13x.xxx.xx -p 2350

SSH tunneling from localhost to 10.80.123.203
# ssh -L 2211:127.0.0.1:2211 konang@10.80.123.203 -p 2350

SSH to 203.13x.xxx.xx via tunnel + forward X
# ssh -X konang@localhost -p 2211

For example on X environment :
# xclock &

You will get "xclock" program from remote 203.13x.xxx.xx

No comments:

Search Linux Resources