01 配置 hosts

编辑 /etc/hosts,添加 IP 地址与主机名的对应关系:

100.111.208.70  raspberrypi-tail
<服务器IP>       raspberry-frp

02 挂载 SMB 共享

安装工具

sudo apt install cifs-utils smbclient

查看共享目录

smbclient -L //host -U user

临时挂载

sudo mount -t cifs //raspberrypi-tail/webdav /mnt/webdav \
  -o username=smbuser,password=<你的密码>,uid=1000,gid=1000,iocharset=utf8

开机自动挂载

编辑 /etc/fstab,添加:

//raspberrypi-tail/webdav /mnt/webdav cifs username=smbuser,password=<你的密码>,uid=1000,gid=1000,iocharset=utf8 0 0

03 Tailscale 密钥

认证密钥属于敏感凭证,不应记录在公开文档或提交到代码仓库。使用时通过安全的密码管理器保存:

tailscale up --auth-key=<TAILSCALE_AUTH_KEY>

04 查看网络连接

查看有线网卡带宽与连接状态

sudo ethtool enp8s0 | grep -E 'Speed|Duplex|Link detected'

查看无线网络

iwconfig wlp0s20f3

05 安装 SVN

sudo apt install subversion

06 SSH 密钥认证

生成 RSA 密钥

ssh-keygen -t rsa -b 4096

把公钥复制到目标服务器

ssh-copy-id user@server_ip

07 管理 systemd 服务

服务配置文件放在 /etc/systemd/system/ 目录中。添加或修改后执行:

# 重载 systemd 配置
sudo systemctl daemon-reload

# 设置开机自启
sudo systemctl enable kdn.service

# 立即启动服务
sudo systemctl start kdn.service

# 实时查看日志
sudo journalctl -fu kdn.service

# 查看最近 50 行日志
sudo journalctl -u kdn.service -n 50

08 创建软链接

ln -s 源文件或目录 软链接名称