Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
2  
i'd also suggest setting up some protection, like fail2ban, while at your at it. –  Journeyman Geek Apr 7 '10 at 9:35
add comment

4 Answers

up vote 8 down vote accepted

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:

share|improve this answer
add comment

You primarily need -- DynDNS,

Free Dynamic DNS

  • Host your own website at home for free!
  • Connect to your workstation, DVR, webcam from anywhere.

You probably want to look at their -- Dynamic DNS Free

Dynamic DNS Free (DDNS) allows you to create a hostname that points to your home or office IP address, providing an easy-to-remember URL for quick access. We also provide an update mechanism which makes the hostname work with your dynamic IP address.

Lookup the link for Readme and HOWTO for detail steps.

share|improve this answer
add comment

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!

share|improve this answer
add comment

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:

  1. Change the port used by your SSH Daemon to listen for incoming connections on a different and unblocked port.

  2. 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.

share|improve this answer
add comment

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.