1

I have a number of linux computers at home, at uni, and my android phone. I'd like some way to be able to SSH to any one of them at any time, but they're all hidden behind different networks, and they may lose their connection or change their external IP address at any time.

Ideally, I'd have some background application, similar to Dropbox, that maintains a connection (reconnects) to some external service with a known address. Then, whenever I want to SSH from one computer to another, the service arranges for a connection to be made. I have a Raspberry Pi that has a DynDNS address and forwarded ports, so I can run the service myself if need be. But it's important that the traffic doesn't go via that server, since I don't want my two uni computers to be sending data home and back when they're sitting next to each other.

Is there software that does this?

Alternatively, is there a free VPN service similar to the old Hamachi that would work across several linux computers and android? Then they would all be on one pseudo-local network and could ssh between each other freely. As near as I can see, there are no such free services at the moment, which seems strange given the abundance of free file-syncing services (Dropbox, Google Drive, Mega, etc).

1

Zerotier seems to perfectly fit your use case:

They call it "Software Defined Networking". It's kind of a mix between a VPN and services like Hamachi. Basically, you have to ability to create networks (that have unique IDs), to which you can connect and authorize devices. It's a P2P network, but can use super nodes if your network doesn't allow inbound connections.

They currently support multiple OSes: Linux, FreeBSD, Android, Windows, OSX.

Except for Android, you can also connect to multiple networks at once. Connecting to a network creates a virtual network card in your OS.

You can also use zeroconf or something like that if you want to use DNS.

It's UDP based, and handles network changes very well. I've experienced it many times with my cellphone switch from wifi(s) to LTE and vice-versa.

  • That looks very good. I've set it up at uni, and the documentation's a bit sparse, but I think I've got it right. I'll see if it works once I get home. – Amanda Ellaway Jun 17 '16 at 5:15
  • You're right about that. There is some sparse information on the net; for example the project creator has answered some questions on a reddit thread somewhere. Their website could use some work in this regard. Hopefully you get your setup working alright! Don't hesitate if you have further questions. – Phil Jun 17 '16 at 5:23
  • So. Did it answer your question? – Phil Jun 17 '16 at 14:31
  • Yes, I had a chance to try it from home last night, and it works beautifully. Thank you! – Amanda Ellaway Jun 20 '16 at 23:09
0

You may consider using SSH tunneling.

Create few tunnels from your RPi device to each other you need access to, and you can SSH to them using local RPi ports.

The problem is if device reboots your connection will break.

  • Yes, this is approximately what I was doing previously. Zerotier (the accepted answer) is working beautifully though, and it maintains itself across reboots of all my devices, which is nifty. – Amanda Ellaway Jul 25 '16 at 2:36

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.