PDA

View Full Version : SSH +forwarding



homebrew89
06-12-2007, 05:40 PM
I've been messing around with something called SSH lately. For those of you who don't know, SSH stands for Secure SHell. Although it can give you what its name suggests, you can also forward selected Internet traffic to and from the server over an encrypted connection. This opens MANY doors as far as what can be accomplished. One thing you can do if you aren't a fan of VNC is called X-Forwarding, in which the X Window traffic which would normally be looped back on the remote host gets sent to you. Essentially this means that you can run programs located on the server on your local computer. Right now my setup is a Linux server in my basement which I connect to with my XP laptop. In order to establish an SSH connection from Windows to Linux, you need a tool called PuTTY. You can configure several authentication methods, but I'll leave that out for now. If you are well versed in Linux, you may be thinking "What good would X Window traffic being sent to my computer do? MS Windows doesn't understand that stuff." However, there is a solution. There is a software distribution called Cygwin which is basically an implementation of Linux on Windows. During Cygwin installation, you can choose various packages to install, and with the right packages you can set up an X Server on Windows! Now with an X Window Server running on your Windows computer, you can successfully forward X Window traffic from the server over SSH. Here's some screenshots:

Here's a text browser called links running in the PuTTY shell window.
http://www.bwhacks.com/forums/attachment.php?attachmentid=8802&stc=1&d=1181696664

Here's some X Forwarding in action. There's 2 Eterms, Wireshark, and AIM, all of which are running on the computer in my basement but being displayed and receiving input from my laptop. See the X in the system tray? That's the Cygwin X server running.
http://www.bwhacks.com/forums/attachment.php?attachmentid=8803&stc=1&d=1181697110

If the server and PuTTY are configured correctly, you can forward other traffic over the encrypted connection. One fun thing you can do with this is forward HTTP traffic and use an SSH server as an Internet proxy server. Or, for added security, you can close ports on your router and access them through an SSH connection to a server inside your network. For instance, I can run vncviewer and access my server by initiating a connection to localhost on port 5900. PuTTY can take the traffic being sent to the local 5900 and send it to the remote 5900, all through the SSH connection, giving me an encrypted VNC connection. Of course, being BWHacks.com, I should state a relevance to Starcraft. One problem that can be solved with SSH is the dilemma with two or more computers on a LAN that want to join the same game on Battle.net. Those of you who have tried it know that weird things happen in the lobby and the gameplay is extrememly slow. Here's how that can be fixed with SSH: Say you have a server at your house running SSH, and you are at a friends house. Configure PuTTY to forward your local traffic on port 6112 to the SSH server. Now, while still within your friends LAN, your Starcraft traffic appears to be coming from your remote SSH server, thus solving the problem.

Now, I know that there are many parts of this post that are vague and not especially helpful. This is because I didn't mean it to be a tutorial, but just to give possibilities of what can be done with an SSH connection. I needed to give some background information so you can have a rough idea of what I am talking about. If you need help, I can make a tutorial upon request.

If you are willing to try this, there is an abundance of information about what else can be done and more out on the Internet.

arpsmack
06-12-2007, 07:18 PM
FYI, in case you didn't know, you don't have to install the entire Cygwin environment just for an X server under Windows.

Here's one alternative:
http://sourceforge.net/projects/xming/