Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
3  
1  
Welcome to Unix&Linux.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Martin Schröder Nov 28 '12 at 20:34
    
@MartinSchröder Since I was a new user, I don't have enough reputation to upvote it. But now I do. –  gavin.lin.asd Nov 29 '12 at 5:57

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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