1013 B
1013 B
SSH - Tailscale setup
Tailscale
Install Tailscale:
curl -fsSL https://tailscale.com/install.sh | sh
Get Tailscale up:
sudo tailscale up
Run Tailscale at boot:
sudo systemctl enable --now tailscaled
To retrieve the IPv4 address (100.x.y.z) on the Tailscale network:
ip addr show tailscale0
SSH
From the client, to copy the public key to your server using its Tailscale IP (or the server's name if MagicDNS is enabled in the Tailnet):
ssh-copy-id [email protected]
To deny root login, password auth, keyboard interactive auth and allow public key auth:
sudo nano /etc/ssh/sshd_config.d/50-hardening.conf
and add:
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
then restart ssh:
sudo systemctl restart ssh
UFW
To allow ssh (port 22) connections on tailscale0 interface only in UFW:
sudo ufw allow in on tailscale0 to any port 22 proto tcp