Setup SSH and Tailscale for Working Remotely

Work from anywhere from any machine

By: Irfan Syafi | Date: April 30, 2025 | Tags: OpenSSH, Tailscale, Network, Remote

Introduction

Ever think of "If I have my laptop computer right now, I could use a little bit of tinkering while waiting for food or writing codes while in a bus to your hometown". We had the same thinking. Last week, while I was on a journey to my friends open house and we have an impromptu plan of staying a night at one of the Airbnb available there. But I worried that I could'nt finish just a little a bit of work on my machine. Luckily, it was not a problem for me because I can work remotely on my Ubuntu from anywhere. Even now, I'm doing coding and writing this article on my phone far from my Ubuntu machine that have my project folder. Since you're interacting with server, tools like AnyDesk, TeamViewer is not possible (as far as I know) especially when you only have your smartphone with you. I'm glad that I've setup both ssh and tailscale on my machine. So here's what I do to achieve this.

Installing OpenSSH

OpenSSH is an open-source tools that helps you to implement a secure communication with your machines through a Secure Shell (SSH) protocol. But SSH only works if your machines are in the same network. It is like walkie talkie where you only can communicate each other if you're in the same channel within a certain radius of communication. By default, your machine will already have OpenSSH client on your device. You can check if OpenSSH client by running the command below in your terminal:

ssh -V

It will show you the version of your OpenSSH client. If not, you can follow these step that I did for my Ubuntu machine:

  1. Update the apt directory using
    sudo apt update
  2. Install the openssh through apt directory
    sudo apt install openssh-server
  3. To check if you successfully install, you can also run the same command previously:
    ssh -V

Congrats, now you already have OpenSSH in your system. Next, I install Tailscale so that I can work outside from any of my devices easily. This is how I'm able to code and write on my phone.

Installing Tailscale

If you ever heard of Twingate, then you would probably know how it works. Tailscale works similarly to how Twingate works. If you haven't, no worries! Tailscale is actually easy to use and very intuitive. Since my primary goal is just to work with my Ubuntu machines remotely, using Tailscale is fairly enough. When both machine have Tailscale with your authentication, technically you are still in the same network. Hence, why you can still use `ssh` to work remotely.

  1. You have to register a Tailscale account and install tailscale on every devices that you want to work with. For me, I have install on my PC, Laptop, Phone and my Ubuntu machine.
  2. To install on the Ubuntu machine, you can refer to the docs here or run the following command:
    curl -fsSL https://tailscale.com/install.sh | sh
  3. Command above requires your machine to have cURL installed. Having cURL in your Ubuntu machines will allow you to download, interacting with API's and testing as long as you have the URL.
    # To install curl
    sudo apt install curl
  4. Then, once tailscale already in your machine, it will prompt you to login to your Tailscale account and connect it with your tailnet (Tailscale network). This is how you'll be able to work within the 'same' network.
  5. If it doesn't you can check your tailscale status or make sure your tailscale is up and running:
    # Check your tailscale status
    tailscale status
    
    # Running your tailscale
    tailscale up
  6. If you're on the phone like me, you can install Tailscale application on App Store or Play Store.
  7. tailscale-on-phone
    Here is how it looks on your phone
    See that my iPhone is connected within the same Tailscale Network (tailnet) with my Ubuntu machine (fanlab-comp).

Additional tools that I use to code on my phone are Termius, you also can install this on your smartphone. It allows you to work on terminal including SSH to your devices at home.

termius-on-phone
SSH using Termius for Phone
using-nano-to-code
Using Nano to write my article anywhere

Now I can work almost anywhere (like literally).

Contact me

If you have any questions or would like to get in touch (I'm also open to learn from you guys too!), feel free to reach out to me through email.