Tuesday, May 19, 2009

Remote access to linux machine through firewalled network

I'm running my linux machine at home as well as windows PC.

this morning I left my PC in power-on condition because some backup work should be done. But i will still be in power-on condition after the backup work done, that is the waste of energy. but I can turn it off because I'm working in my office.

So I tried to connect to my windows machine via linux computer which runs 24 hours a day. It is possible to use remote desktop service runs on Vista.

Only remaining problem is a running X windows program in my office PC.
It need some trick called ssh tunneling.

I installed Xming to run X server in my office PC.
to run the X application, i use plink.exe which installed with putty ssh client.

Method is very simple.
First, start the Xming server in my office PC.
And start command console in same machine.
move to the folder putty is installed.
and type plink and some connection info.

here's my case.

C:\PROGRA~1\iPuTTY>plink -ssh -X -P 27 -pw aaa user@mylinuxpc.com xterm

(note: -P 27 is option for non-regular port number.
this option is required because my company block official ssh port(22) so I changed ssh port to 27 in my linux machine.)
then I can use any linux X application through this xterm.

I started tsclient program and tried to connect to my vista machine.