How to run an SSH server without a static IP address

I have a powerful computer in the lab and I installed Ubuntu 11.10 64-bit on it. I want to install an SSH server on it, so I can reach it from home and even from my Android via ssh. But I haven't got any experience on creating an ssh server.

The machine has a dynamic IP. I don't want any other ssh users, installing it only for myself will be enough for me.

Where should I start? What tools do I need and how would I configure them?


To get started with ssh in general, install openssh-server.

sudo apt-get install openssh-server

On the next restart, this should start up automatically. To connect to the computer remotely, just enter the following in a remote terminal, substituting the ALL-CAPS names for your own:

ssh USERNAME@IPADDRESS

Now, to take care of the dynamic ip forcing you to recheck the IP all the time:

Get a free account on dyndns.com and choose the name you want to type when you connect.

Once that is done, install "ddclient" on the server machine. This will automatically update the IP address for you with dyndns.

sudo apt-get install ddclient

When you run it, it will ask you a series of questions, so have your username, password, and the URL you chose earlier ready to type in. It should also automatically add itself to startup.

That should be it. Now when you ssh, just use the URL you chose instead of your IPADDRESS since this should automatically update if the IP changes.

If you have a router, make sure to forward port 22 to your server! There are lots of guides on this at portforward.com for your specific router.


You could get a hostname via a service like http://www.noip.com/ and then setup a ssh server. you would then connect via e.g.

ssh [email protected]