Jul 13, 2022

Connecting to your servers from phone without adding SSH keys

For both of my projects (https://ossdatabase.com and https://profilehunt.net), I use VPS deployments. For each of these Rails-based apps, I have a light sail instance. To keep track of errors, I use Honeybadger. I occasionally receive notifications when something is off. When I am away from my computer, this is a problem. in particular while I'm outside. I would like to access to my servers in these situations so I can immediately determine what is wrong. I occasionally just want to connect to the server and look around.

The greatest choice I have is SSH. I can securely connect to my servers via SSH. However, in order to utilise SSH, I will need to either generate a new public key or transfer my existing key from my PC to my phone. It might not be a good idea to leave SSH keys laying around on my phone. Additionally, having to perform this setup for each server I install is a little awkward.

Enter Tailscale

The mesh network Tailscale (https://tailscale.com) is based on the Wireguard protocol. The simplicity with which Tailscale operates is its coolest feature. You can use it to set up a private, secure VPN between your devices. Although I had tried tailscale, I hadn't really used it till recently. They recently made SSH support for the Tailscale network available. It clicked for me to right away. My servers, computers, and phone were already connected to the Tailscale network. All I had to do was activate SSH in the administrative console and test SSH. And it succeeded! It performed flawlessly. It was as easy as typing ssh user@server-name-i-assigned on my phone's bash emulator.

Steps

On your servers

On your phone

  • Install Tailscale
  • Login
  • Connect to Tailscale network.
  • Use a terminal emulator like Termux to use ssh and connect to your server. ( ssh user@ip-address )

See Tailscale docs for references.

Tailscale also supports assigning custom hostnames with custom DNS. In this manner, readable hostnames can be used in place of IP addresses. As a result, you can access servers using ssh user@hostname.

To get it functioning for a more complex system, you might need to muck around with certain ACL settings. The settings were relatively easy to set up because I was the only user on the network, (see docs). The only thing I would change about Tailscale is how laborious it is to configure the ACLs; a user interface would be helpful. But perhaps that is just me, and it might be simpler for others who do administrative tasks frequently.

Subscribe to Open Source Businees Newsletter

Twice a month we will interview people behind open source businesses. We will talk about how they are building a business on top of open source projects.

We'll never share your email with anyone else.