1

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.

6
  • 1
    I assume you have a normal ISP and the server at home is behind a router. Did you forward port 22 through the router to your server? Are you using the external IP address of the router when you are away from home? Sep 22, 2013 at 1:15
  • I think that I did. Here is a screen shot i1303.photobucket.com/albums/ag148/Greg_Ruth/…
    – Greg
    Sep 22, 2013 at 1:20
  • Port forwarding looks good. Now, when you are away from home, what IP address are you trying to connect to? 192.168.0.18 won't work. You need the external IP address of your router. Sep 22, 2013 at 1:23
  • Can't believe I wasn't using the right address. Thanks a lot. How can I get a hostname to work instead of the the address. ([email protected] instead of [email protected])
    – Greg
    Sep 22, 2013 at 1:26
  • Post in the answer so I can up rate you
    – Greg
    Sep 22, 2013 at 1:26

3 Answers 3

4

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.

2
  • 1
    Another option for a hostname would be just his own in the hosts file. Obviously isn't for sharing - but saves the need to type the IP for local use. Though there are many options for option #2, I've seen many mentioned around here (the names escape me this evening). +1
    – nerdwaller
    Sep 22, 2013 at 5:14
  • Or he can specify the hostname and IP address in ~/.ssh/config. Aug 19, 2016 at 17:50
1

Yes you can. I coded this service 3 years ago. I wrapped a nice web and make it public. I am using it to service few the R-PI's running Urbackup on private networks for few clients check :
https://mylinuz.com

1
  • Still running it?
    – Merc
    Jun 9, 2023 at 15:40
0

You need a static public IP address from your ISP (diff: Public and Private IPs).

Once you have public IP assigned to your server, register and host your DNS name - Howto

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .