koshimazaki/tailscale-runpod
Overview
This skill sets up Tailscale on cloud GPU instances (RunPod, Vast.ai, Lambda, Paperspace) so you can SSH directly over a secure mesh VPN. It preserves a persistent Tailscale state across pod restarts and avoids exposing public ports. Use it to get reliable, encrypted SSH access and easy file transfer to ephemeral cloud GPUs.
How this skill works
The skill installs tailscaled, runs it in userspace-networking mode (required for containers without a TUN device), and brings up a Tailscale node with SSH enabled via tailscale up --ssh. It stores the daemon state on a persistent path (e.g., /workspace/tailscale.state) so the instance keeps the same tailnet identity after restarts. You then SSH to the instance using the Tailscale IP shown by tailscale ip -4 or use rsync/scp over the Tailscale link.
When to use it
- You need SSH access to a RunPod, Vast.ai, Lambda, or Paperspace GPU instance.
- You want to avoid public port exposure and NAT/port-forwarding headaches.
- You need a persistent IP for reconnecting to ephemeral pods after restarts.
- You want encrypted, peer-to-peer transfers for models or outputs.
- You need a simple workflow for uploading/downloading large files reliably.
Best practices
- Run tailscaled with --tun=userspace-networking in the background and set --state to a persistent directory on the platform.
- Always run tailscale up --ssh to enable Tailscale’s built-in SSH server for container environments.
- Store the state file under the platform’s persistent path (e.g., /workspace/ for RunPod/Vast, /home/ubuntu/ for Lambda, /storage/ for Paperspace).
- Use rsync --partial --progress for resumable large file transfers and --block-size for more reliable chunked transfers.
- Keep a small set of shell aliases for quick ssh/rsync commands and maintain the RUNPOD_IP env var locally.
Example use cases
- Start a RunPod session, run the install/start commands in the Jupyter terminal, click the auth URL, then ssh root@<TAILSCALE_IP> from your laptop.
- Copy large model weights from your workstation to the pod with rsync --partial --progress and a block-size suitable for unstable links.
- Create dated download folders locally and use rsync to archive outputs from multiple pod runs for reproducibility.
- Recover a restarted ephemeral instance by preserving tailscale.state on the persistent path and reconnecting with the same Tailscale IP.
- Use tailscale status and tailscale netcheck to diagnose connectivity or relay fallbacks when direct peer connections fail.
FAQ
Yes — browser auth is required for container SSH in many environments. Auth keys are often unreliable for unprivileged containers, so click the provided URL after tailscale up --ssh.
Why use userspace-networking?
Containers typically lack kernel TUN, so --tun=userspace-networking runs tailscaled without requiring special kernel features.
How do I persist the Tailscale state?
Set --state to a path on the instance’s persistent storage (e.g., /workspace/tailscale.state) so the node keeps identity after pod restarts.