header image

remote access

have you seen this?

American Idol: Chinese Ricky Martin-thumbnail
American Idol: Chinese Ricky Martin


have you played this?

Shift 4-thumbnail
Shift 4



free money is always good, too...

This article is a slight modification to this article:

From any machine connected to the internet, you can connect to your machine at home, if it is turned on. We simply need to configure your router and computer to accept your connection, and allow a VNC takeover. Per the Erik Heels article, we will secure this with ssh through cygwin.

1. Set a static IP in Windows. It may be easier to use 192.168.1.100 (assuming your router is your dhcp server, and is using that subnet). Don't forget to set your default gateway (your router's IP) and provide DNS information. Go to OpenDNS for some good servers, use your modem's internal IP, or take note of your ISP's DNS servers you are currently using.

2. Configure your router. First, remove the IP you just used from the router's dhcp pool. Otherwise, if you have other workstations using this router, one day you may find someone stole your IP. Next, go to your port forwarding page. Forward a port that is currently not being used by anything to your computer's now static IP. (2007 will be the example port)

3. Install cygwin. Download setup.exe into c:\cygwin. Run setup, and select Instal from Internet. Install to c:\cygwin for all users, and use Unix file types. Local package is c:\cygwin. Select direct connection and pick a server. Select these packages to download: (Admin section) cron, cygrunsrv, shutdown (Archive section) cabextract, sharutils, unzip, zip (Net section) autossh, openssh, ping, rsync. Create your icons if you wish. Now it will say it is finished, but we still have work to do.

4. Set environment variables. Right-click My Computer, Properties, Advanced, Environment Variables, System Variables. Click New, call it CYGWIN and make the variable value "ntsec tty". Now go select the PATH variable, go to the end of the existing string, and add on ";c:\cygwin\bin".

5. Start cygwin bash shell. Type ssh-host-config. Answer yes to the next three questions, and then type "ntsec tty" to the variable question. When that is done, at the prompt type net start sshd, net stop sshd, net start sshd. If that works, then the service is working. Type passwd, and type in the password you will use. This may or may not be set for you already.

6. Change the default ssh port. Copy the file from c:\cygwin \etc\sshd_config to the desktop. Open it in WordPad, and find where it says Port 22. Change the 22 value to 2007. Save the file on the desktop. Copy it back to the cygwin\etc folder. Open the bash shell again and type net stop sshd and net start sshd. Your changes should now be in effect. To test this, type ssh p 2007 "yourusername"@192.168.1.100 you should get a message asking about key authenticity. If you see this, things are working right. Answer no to the question.

7. Set up UltraVNC. Available here. Install UltraVNC server as a service when it asks during installation. It may complain about missing certain user accounts. Continue, and provide a good password in the configuration window. Also, make sure loopback connections are enabled. Your server should be working at this point.

8. Prepare your USB drive. Do a Google search for Putty, a free telnet/ssh client. Download putty.exe onto your USB drive. Also, download the UltraVNC viewer. Be sure to grab the version that is a single executable that does not require installation.

9. Test the remote connection. Go to someone elses computer on your private network. Start Putty. In host name or IP address, you will need to know your outside IP. Various online services can tell you this. Since this address can change over time, see the section at the bottom about DynDNS. Otherwise, insert your outside IP, and the port number 2007. Go down to Tunnels, and add the Source port of 5900 (default vnc port). Under destination, type 127.0.0.1:5900. Then click Add. Open the connection. A window should pop up asking you whether to accept a key. Say yes. Type your username, then password. You are now connected to your machine by SSH.

10. Start UltraVNC Viewer. The viewer will ask your for an IP. Type 127.0.0.1. Password is whatever you defined in the UltraVNC server configuration. You should now see your desktop in the Viewer window. It may be laggy, but should be serviceable. There are also functions at the top for file transfer.

11. Close the connections. To end your session, simply close the UltraVNC Viewer window. Type exit in the bash shell window. Very simple!

Notes About DynDNS:
DynDNS.org is a company that provides some excellent services. For this article, you could create an account and use the free Static DNS service. You create an address that is easy to remember (yourname.dyndns.org), and have it update the records as needed. This way, when your ISP changes your IP, yourname.dydns.org is updated with the change, and you can still connect to your machine remotely. Simply use your DynDNS url in place of an outside IP in the Putty configuration window.
Updating DynDNS can be tricky if you are not using an actual software client to do it. Router support for DynDNS is not always reliable. DynDNS has an application you can install on your machine whose sole purpose is to touch your DynDNS account and make sure it is updated. This also ensures that your account is not purged for inactivity. Go to DynDNS.orgm for more information.

Extra Notes about UltraVNC
UltraVNC (and other flavors too, I imagine) get flagged by virus scanners and anti-spyware apps as potential threats. They can be, especially if it is installed without the user being aware of it. Since we did this on purpose, ignore the warnings.



Applications needed for this how-to:
Cygwin
Putty
UltraVNC Server
UltraVNC Viewer