Hostmonster Subdomain redirected to home server IP: How to ssh into home server using subdomain


I setup a home server to play with. Instead of remembering the IP address, I created a subdomain on my hostmonster personal website ( and redirected it to point at my server at home.

On my router firewall at home, I forwarded port 80 and 22 to allow web and ssh to get through to that server.

It seems, however, that my webhost forwards the port 80 requests, but does not forward ssh requests. I came to that conclusion after noticing the following:

When I access I successfully see the web pages hosted on my home server. However, when I ssh into I cannot authenticate. ssh'ing into homeusername@homeIP works fine.

I also found that ssh'ing into will ssh successfully into my web account.

Does anyone know how I can setup that kind of 'ssh forwarding' ?

Thanks in advance,

Best Answer

  • You need to go into your domain's name server, and create an A record for your subdomain that points at your home IP. If you don't have a static IP at home, then you'll need to setup a dynamic DNS. There are many Dynamic DNS providers on Google; find one you like.

    The key part of your question is that you "redirected" your subdomain to point at your server at home. I assume that you used something like the HTTP refresh header. When you try to reach your home server through the redirect, this is how the flow works:

    1. You send a request on port 80
    2. The Hostmonster server receives the request on port 80
    3. The apache server sees the redirect, and forwards to the redirect's port 80
    4. Your request reaches your home router on port 80
    5. Your request reaches your home server on port 80

    Now here's what happens when you try to ssh into your home server:

    1. You send a request on port 22
    2. The Hostmonster server recieves the request on port 22
    3. The Hostmonster sees that your user doesn't exist on the server; access denied

    The difference is that on port 80, apache sees the redirect. On port 22, sshd doesn't know about a redirect and believes you're trying to ssh into the Hostmonster server.

  • Related Question