I am pretty to new to SSH and I have a question regarding access to my machine outside network.

I have a Linux machine sitting in my apartment running almost all the time and connect to the network through a router. I want to be able to ssh into it from outside the network on my laptop (can ssh within network using private address already). After some research, it seems like I need to enable port forwarding but I am not sure how to do that.

Also, I have a domain myself and I would like to bind a sub-domain (ssh.example.com) to my ip address and have my desktop update the binding everytime it reboots (check if ip changed, if so update the domain). Is there a tutorial online for these?


You should log into your router via webinterface and add port redirection. How to do that? It depends on model of router that you have but it should't be hard to find in menu. In my TP-Link WR340G there is menu Forwarding -> Virtual servers where you can add your redirections. When you configure that you will be able to connect by calling ssh YOUR_PUBLIC_IP.

For the second part: it depends if you have dynamic IP address or not. If address is not changing just add new sub-domain with your IP address. If it is dynamic you should check out services like NO-Ip (No-IP Free, but it allows only for subdomain in their domain) or DynDNS. Specific instructions you can find on webpages of that companies. They also provides clients for updating IP addresses.

  • Thank you so much! I am able to forward the port but still trying to bind a subdomain to it. – gavin.lin.asd Nov 28 '12 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.