Connecting to your Ubuntu Server remotely
As you already know, my wife is using an old computer running Ubuntu for her web development server. I can’t see the point in having a monitor plugged into it when all she ever needs to do is either a) alter the DocumentRoot when she works on a different site or b) wants to shut it down (rarely).
Here’s how we can do all this remotely from our Windows desktop.
Installing SSH on Ubuntu desktop
sudo apt-get install ssh
That was so easy it barely needed its own heading. SSH stands for Secure SHell and allows us to make a secure direct connection with our server. To do this we need to use an SSH client.
Connecting to our server using PuTTy
PuTTY is a free and simple ssh client for Windows. Simply download the latest version here and then run it.
Type in your Ubuntu server’s IP address where it says ‘Host Name (or IP address)’ and then hit the ‘Open’ button. From here you simply login with your Linux username and password. Now you are sitting at your Windows desktop machine but using your Ubuntu Server’s command line as if you were right there on your server.
TIP: if you want to remotely shutdown your server you type in:-
sudo /etc/sbin/shutdown -h now

Pete wrote,
Hi Ian.
Firstly thanks for your excellent items on setting up a LAMP server using Ubuntu Desktop as a base. I now have my own website up and running on an old compaq Pentium 4 in the garage !
Coupled with wordpress its all fairly straightforward, one you have got used to googling to learn Linux command syntax etc.
I am struggling with Putty though. I have installed SSH on the ubuntu box (as you instructed), and I installed putty on my windows machine . When I start putty and pop in the ip address of my ubuntu box I get …
2008-08-24 14:52:12 Looking up host “198.162.0.200″
2008-08-24 14:52:12 Connecting to 198.162.0.200 port 22
2008-08-24 14:52:33 Failed to connect to 198.162.0.200: Network error: Connection timed out
2008-08-24 14:52:33 Network error: Connection timed out
And that is the correct IP address ….
Any advice ?
Thanks
Pete
Link | August 24th, 2008 at 1:57 pm
Neil wrote,
Hi Pete
I will assume you can connect to your Ubuntu machine from your Windows machine when it comes to seeing your website on there?
To make sure that the SSH server is working on your Ubuntu machine correctly we’ll attempt to login to it from itself!
From your Ubuntu command line type:-
ssh username@localhostWhere username is of course your username. If that didn’t work then for some reason the SSH server on your Ubuntu machine is not working.
Assuming that did work then my best guess is that it’s a firewall issue stopping you connecting via your Windows machine using PuTTy. Have you got any specialized firewall or internet security type software running on your Windows/Ubunutu machine?
Finally you could try seeing if your Ubuntu server is actually ‘listening’ for ssh connections by typing in:-
netstat -platYou should see something like:-
Let me know how you get on please.
BTW my name’s Neil and thank you very much for your kind words regarding my previous posts.
Link | August 24th, 2008 at 2:14 pm