Search

Google
 

Sunday, December 30, 2007

Linux on Any Platform for Free, Fast Low-Level Remote Control

I wonder about the merits of services like GoToMyPC, the easy-to-use, but for-pay service for remote controlling your desktop PC from anywhere. I've read great reviews about GoToMyPC, but the Do-It-Yourself-er in me rebels at the notion of paying for such a service when so many free alternatives abound. Besides, all the "mothership" PCs I need to control remotely are either running OSX or Linux, and GoToMyPC is a Windows only solution, so far as I know.

I plan to post something soon about free Virtual Network Computing (VNC) solutions, which allow allow remote control of a PC via its GUI. (On your "client," your Internet tablet, or laptop, or whatever, you see the full blown graphical desktop of the "server," the sedentary machine in your home or your office or your company headquarters or wherever.)

But first, I want to start at a lower lever with a few handy Linux commands. While you're out roaming around, you're likely to encounter some areas of pretty low bandwidth. VNC can be pretty darn slow even with plenty of bandwidth, and so often you're logging in remotely just for a simple task like grabbing a file.

If you haven't already, why not just master a few basic Linux commands that will dispense with all the slow loading graphics and get the job of grabbing that file faster and with ample security?

First, you'll need to install a few free applications on both the server and the client:

Server-Side Installation
Good news! If your mother ship is running OSX or Linux, you're already done.

OSX comes with OpenSSH preinstalled, so all you need to do is enable remote logins (click Apple Menu>System Preferences>Sharing and check Remote Login).

Your Linux server is already likely to be running and ssh server, but you may need to do some tweaking. This will give you some ideas.

Windows is going to be tricker to configure, but certainly not impossible. Have a look here as a place to start. Basically, you're going to need to install Cygwin, OpenSSH, CoreUtils, or some other variant in order to allow remote logins and support for core Linux commands.

Client-Side Installation
Again, if your client machine (the one on the road with you) is a Linux or OSX laptop, you're done. Just open up a terminal.

On a Mac, you do so by opening Finder, then clicking Applications>Utilities>Terminal.

On Linux machines, you typically right click on the Desktop and then select Open Terminal.

If your carrying a Windows, laptop around you'll need to install an ssh client of some sort. A few options are listed here.

If you're carrying something smaller, like an Internet tablet, there's a ready supply of ssh clients. Here's advice on getting an ssh client running on your iPhone (I imagine something similar is possible for the iPod Touch). Here's advice for the same on a N series Nokia tablets running Linux (770, 800, 810) -- pay attention to the bits about osso-xterm and ssh.

It looks like Windows-based pocket PC users have options as well, which are discussed here.

Networking
Here's where we could easily wander outside the scope of this post. To keep it simple, from the server you need two things: its IP address (written like 63.208.196.66) or hostname (written like (ssh.mothership.com) and a firewall allowing traffic on port 22.

There are tricks like port forwarding available to you, if you don't control the firewall in your office or head quarters. (Basically, you forward a port by running a simple command before leaving the office, then follow this port back from your client PC while you're away.)

Also, there are tricks available for assigning a hostname to an IP address, even if it's a dynamic (i.e., ever changing one) assigned according to the whims of your Internet Service Provider (ISP). Check out this free service, for example.

Copying Files and More Remotely
Depending on your background, all the above might sound quite onerous, but it's really not, and once it's all setup, you can find the command line to be a very powerful ally.

Say you want to copy a file off the mothership. All you need to do is open up a terminal on your client PC, and type something like

scp username@ssh.mothership.com:/pathname/to/file/filename .

You'll be prompted for a password, and the file will start downloading to your client.

Say you can't remember where the file is. You can log onto the mothership with

ssh username@ssh.mothership.com

Once on, you can find the file by using ls, which will show you the contents of the current directory, in conjunction with cd, which will change directories for you (cd .., for example, takes you up one directory level in the hierarchy, while cd directory_name takes you inside the named directory.

This is all just the tip of the iceberg, obviously. Once you master a few commands, you can easily download files, backup the contents of your roving PC to the server via rsync (only the the changes since the last backup, not everything, so backups are fast), and much more. Seriously, a whole free world opens up, and, again, these tools are great because they do so well in low bandwidth situations (they were, after all, born in the 1970s!).

No comments: