Remote Administration through Tailscale

We're going to:

  1. Configure a lightweight Debian VM and install Tailscale in it.
    DISK:   "8 GiB"
    CPU:    "1 Thread"
    MEMORY: "1024 MiB"
    
  2. Setup Passwordless SSH and Non-Root SSH
  3. Subnet routers and traffic relay nodes
  4. Set it up as an exit node
  5. Enable Auto Updates with Unattended Upgrades

If you want you can use the following little script:

#!/bin/bash

echo "Please enter your local network (e.g.: 192.168.0.0/24):"
read network

echo "Setting up UFW"
sudo apt install ufw -y
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow from $network to any port 22
sudo ufw enable
sudo ufw status verbose
sudo ufw reload

echo "Installing Tailscale"
sudo apt install curl -y
curl -fsSL https://tailscale.com/install.sh | sh

echo "Enable IP forwarding"
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf

echo "Starting Tailscale"
sudo tailscale up --advertise-exit-node --advertise-routes=$network

Relevant Note(s): HomeLab Networking