"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects." (Robert A. Heinlein)

Friday, 5 February 2010

Remote controlling a Linux machine

One of best things in Linux is that it gives you for free features that, in other operating systems, are supposed to be limited to professional versions.
One of the first things I learnt about Linux has been how to remote control it. Not surprising if you think the first Linux machine I regularly started working with (PIII550) is a headless one.

Installing OpenSSH daemon

In order to remote access a Linux machine a SSH server daemon must be installed (OpenSSH in this case). In Ubuntu this is just matter of a single apt-get command
sudo apt-get install openssh-server
once install completed you can access the remote machine by typing
ssh remote-machine-ip-address
Tired of command line?

Remote control in Linux is not limited to command line. If you type from your client machine:
ssh -X remote-machine-ip-address
then, while in the remote machine, you might need to set the DISPLAY environment variable:
export DISPLAY=local-machine-ip-address:0
you can then run your X11 applications



Controlling Linux from Windows

I've been talking about controlling a Linux server from a client also running Linux but, after installing some extra applications, you can easily access a remote Linux machine from a Windows client.
A good SSH client fro windows is PuTTY, zip or executable install version are available. If you are willing to run remote X11 applications you'll need to also install a X server for Windows. Xming is a good one I tested.
In order to use X you'll have to check the “Enable X11 Forwarding” option on Putty settings

screenshot-putty


once logged you'll have to set the DISPLAY environment variable.

xming-screenshot


Controlling Linux from the Cell-phone

You can even control your remote Linux machine from a cell-phone, at least from a Symbian phone like mine, using wireless LAN. A good port of PuTTY to Symbian S60 can be downloaded from here. It's honestly not the easiest way to work, Putty on cellphone works fine, even on touch phones like Nokia 5800, but if you are really willing to use it better you buy at least a phone with a full QWERTY keyboard.



Links