Monday, February 21, 2011

Port forwarding and VNC configuration

Weeks ago I got a free computer from home, you know they are going to get new ones and they are giving away the old ones. Anyways this new computer is not really the best thing. It must a Pentium 4 with 2 GB of RAM and it came with out OS. I installed Ubuntu 10.10 on it since it seems my Linux knowledge has been failing.

It is the first desktop I have since a lot of time and right now is working like a dedicated server. It was good but one thing was missing. I couldn't access it from outside my home network which sucks like from work for example. Especially my NAS ( Network Attached Storage ) which has a lot of information, installers and pretty much everything I have.

I did some research and at the end everything worked just fine and these are the steps to do it if you want something similar. This is working just fine on Ubuntu, but it should also work with Windows or Mac.
  • Install ssh server if you want to use command line which I like :) or if you want to remote desktop, you can install tightVNC which has the server and the viewer versions. Ubuntu comes already with VINO which is its built in VNC server which is good but has some limitations.
  • Look into your routers documentation and find a way to configure port forwarding. This basically redirects traffic based on ports and IP's. You open a port and a IP that is going to receive the request. It is worth saying that opening ports in your router is a security breach and you need to be very careful when doing this, like having a good firewall, really good passwords, etc etc. Having said that let's continue. Once you know how to enable port forwarding in your router you need to open two ports: 22 for ssh and 5900 for VNC. These are the default ports these application work with, but can configure the application to work in a different port. In VINO it is a little bit difficult I do not know about tightVNC, it must easier though. This is how it should look like.
  • Once you finish the configuration you need to restart the server and router so the new configuration would work.
  • If everything is working fine, it is time to test. In oder to test it you can ssh your server using your public which you can find by using whatismyIP or any tool like that. The easiest way to test using Windows is using Putty which is a free ssh and telnet client. If it works, you should be able to log in using your Ubuntu user name and password.
  • If you want to test it using VNC, you will need to install tightVNC client in windows and connect using your public IP and again you should be able to log in using your same Ubuntu credentials.
More information about configuring port forwarding with VNC can be found here. It should be a pretty straight forward configuration, but again opening ports to the world can be really dangerous for your security so be very careful.

No comments:

Post a Comment