How can I set my computer up for remote SSH access?
I have a Linux machine that I can access by SSH from my laptop when I am inside my house, but when I am using another Internet connection, I can't connect.
What do I need to do?
I have Verizon DSL Internet and an ActionTec modem, if that matters. If there are other relevant facts I'm omitting, please let me know and I'll improve my question.
You will have to log in to your modem/router to forward the port your SSH server is listening on (usually 22).
From there, while using your client, make sure you're connecting to your outside IP address (the one assigned by your ISP) instead of your internal one assigned by your router in your home network.
Useful links:
- Forwarding ports - http://portforward.com/
- Finding your IP address - http://www.whatismyip.com/
- Create a domain name that points to your home IP http://www.dyndns.com/
You'll need to forward the right port from your router to your Linux machine. As you probably know, Port 22 is the standard port.
However, some ISPs (possibly yours, but I have no facts to support this) will block the port.
Thus, you have two options:
Change the port used by your SSH Daemon to listen for incoming connections on a different and unblocked port.
If that's not possible, map a public port to port 22 on your router.
Thus, all traffic on <public port of your choosing> is forward to port 22 on your Linux machine. This has the advantage of not changing your Linux machine, and all you need to do is specify the new port when you're connecting away from home.
Your modem may refer to 'port forwarding' as 'firewall', 'address translation' or 'virtual servers', or similar.
You can use the ShieldsUp! feature at Gibson Research Center to perform a portscan of 22, and see if you've opened it. (Of course, if you're using a different public port, then you would scan that port).
Finally, as others have suggested, I recommend DynDNS to provide you with a non-changing name to address your computer on the Internet.
This is a pretty simple problem but it will require you to address it at a few levels. Firstly you will need to make sure SSHD is running on your Linux box so that SSH is available.
Next you will need to configure your router to port forward all SSH traffic to the SSH port on your Linux machine. Next you will need to set up DynDNS to give your Linux box a name that resolves on the Internet.
http://dyndns.org
Happy Hunting!