Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I often find I want a file on my home machine when I'm out and about, so I would like to set up ssh server on my home machine to be able to login securely over the internet. It's my understanding that this requires to set up some port forwarding on my ADSL router at home, and then I can ssh in (using the ADSL router's IP address) and it should be secure using a public/private key pair I can make with ssh-keygen.

My question is, doesn't it require my router's IP address to be static or known beforehand? As far as I know my ISP might change my IP address dynamically, so I might find I can't log in some days without going home and googling for "What's my IP address?". Is there a usual way around this, and how frequently do consumer ISPs change your IP address typically anyway?

As well as a massive amount of files, I also want access to processes and devices, so I'm not interested in cloud or dropbox like answers.

share|improve this question
I have had the same IP here at this house for 5 years. Obviously it's not going to be the same for everyone but they don't just up and change it unless your modem is offline when your lease expires and even then you'll get it back unless someone else gets it instead. So low chance it will change. – Paperlantern Jan 10 '12 at 3:30
Where I am at, if I turn off my router for 12 hours or more, many times I will get a new IP. Less than 12 hours, and I'll always get my old IP address back. I have also tried this by changing the router MAC address, and then change it back after 12 to 24 hours. The longer I go past 12 hours, the more likely I can't get the original IP back. – Kevin Fegan Nov 13 '12 at 6:04
up vote 11 down vote accepted

Easiest way to deal with this is to use a dynamic DNS service... I use Dyndns. They are more into premium services these days, but you can still get a free domain from them...

Google Dynamic DNS and you will find lots of others.

Many routers have a hook into these services built in.

share|improve this answer is what I've been using for a few months. The client works well to keep your IP up to date, but it's pretty much the same as dyndns – Rob Jan 30 '12 at 15:18
couldn't ssh home yesterday, and it turned out to be due to my ip address having changed. so now i am going to look into a free dynamic dns, thanks. – wim Feb 16 '12 at 11:20

Hear me out, you don't want to use dropbox for all your files but how about using it to keep your IP address handy? I use a bash script to find my IP every hour and record it in a folder in Dropbox. Then I always have my IP address handy because Dropbox is available for my smart phone. Then I just look up my IP and login to my server through ssh using key pairs from my netbook. I have blogged about this here:

share|improve this answer
neat idea. a bit more stuffing around than dynamic DNS, but I can see how that would work. – wim Feb 27 '12 at 23:03

If you do have access to a public IP that you can SSH into, you can set up a reverse tunnel from your local computer using ssh -R 20000:localhost:22 user@publicipaddress. You'll have to do a little work to keep it persisting through network disconnects, but otherwise it works and is already built in. Look up ssh reverse tunneling.

You should also take a look at pagekite for a reliable way to punch through various subnets.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .