Can't access my ssh linux server when outside network

So I've been scouring the internet for days trying to figure this out and can't figure it out.

I know its going to be an easy one.

So I recently took an old desktop and loaded ubuntu server 12.04 on it. My goal with this project is to create an area to host a few git repositories and maybe a simple webpage.

I've installed both the SSH and Apache2 packages and tried to configure them. Right now I can log in from my laptop using ssh [email protected] but only while I am on the same network. Once I leave the house I get a timeout error.

So 2 things I would like to get at right now.

How to configure the SSH to allow me to access the server from outside the network. Get my host name on the server so logins will be greg@hostname instead of [email protected]

(I've done sudo hostname and changed the etc/hostname file and no results)

Thanks guys.


When you are away from home, you need to use the external IP address of your router, with port forwarding configured, to connect to any computer inside your home network.

If you want to use a hostname to get back to your home network when you are away from home, you have two options:

  1. Purchase a domain name from a registrar (I use Hover) and point that name to the external IP address of your router.

  2. Get a domain name from a (possibly free) dynamic DNS service and point that name to the external IP address of your router.