在 Linux 上安装 Tailscale
本指南说明如何在 Linux 上安装和设置 Tailscale,使系统可以参与远程控制功能。
支持的系统
本指南适用于大多数现代 Linux 发行版,包括:
- Ubuntu
- Debian
- Fedora
- Arch Linux
- Linux Mint
- Raspberry Pi OS
适用于:
- 桌面系统
- 服务器
- 无头设备
此设置的作用
完成本指南后:
- Tailscale 将安装在 Linux 上
- 系统将加入您的私有 Tailscale 网络
- 设备将获得一个 Tailscale VPN IP
- Turn Off PC 中的远程功能将跨网络工作
步骤 1:下载 Tailscale
- 打开网页浏览器
- 前往 Tailscale → 下载
- 选择您的 Linux 发行版
Tailscale 为大多数发行版提供官方软件包。
步骤 2:安装 Tailscale
按照您发行版的说明操作。
Debian / Ubuntu / Linux Mint
curl -fsSL https://tailscale.com/install.sh | sh
Fedora
sudo dnf install tailscale
Arch Linux
sudo pacman -S tailscale
Raspberry Pi OS
curl -fsSL https://tailscale.com/install.sh | sh
步骤 3:启动并启用 Tailscale
启动 Tailscale 服务:
sudo systemctl enable --now tailscaled
步骤 4:登录 Tailscale
使系统上线:
sudo tailscale up
将显示一个 URL。
- 在浏览器中打开该 URL
- 使用您的 Tailscale 帐户登录
- 授权设备
授权后,系统加入您的 Tailscale 网络。
步骤 5:验证连接
检查连接状态:
tailscale status
确认:
- 设备出现在网络中
- 状态为活动
可选:查看 Tailscale IP 地址
查看分配的 Tailscale IP 地址:
tailscale ip
步骤 6:让 Tailscale 自动运行(建议)
Tailscale 通过 systemd 自动运行。
验证方法:
systemctl status tailscaled
服务应处于活动状态。