本篇设置也适用于centos8stream
官方网址:https://syncthing.net/
- vps下载和安装
1)下载syncthing
cd /root wget https://drive.fanlog.org/sync/syncthing-linux-amd64-v1.25.0.tar.gz tar -zxvf syncthing-linux-amd64-v1.25.0.tar.gz
2)配置系统的systemctl
nano /etc/systemd/system/syncthing.service
[Unit] Description=syncthing After=network.target nss-lookup.target [Service] Type=simple Restart=always User=root Group=root WorkingDirectory=/root/syncthing-linux-amd64-v1.25.0 ExecStart=/root/syncthing-linux-amd64-v1.25.0/syncthing -no-restart -logflags=0 -no-browser [Install] WantedBy=multi-user.target
启动服务
systemctl enable syncthing systemctl start syncthing
3)修改配置文件
nano /root/.config/syncthing/config.xml
4)防火墙的设置非必要
systemctl restart firewalld firewall-cmd --permanent --zone=public --add-port=8384/tcp firewall-cmd --permanent --zone=public --add-port=8384/udp systemctl restart firewalld
- web设置
http://ip:8384



- 文件同步测试
win10 下的客户端配置和联网同步
win10下载地址:https://syncthing.net/downloads/,配置也是直接配置用户名和密码
1)vps端的syncthing设置


2)win10 syncthing连接到vps的syncthing

此处填写vps的syncthing的设备ID
3)测试效果:

ssh检查的文件
- 小结
测试通过。
参考资料:
- https://www.xiaoz.me/archives/7708
- https://ourob.net/Syncthing-discover-server-and-relay-server-setup/
- https://zh.codepre.com/how-to-7168.html
- https://zhuanlan.zhihu.com/p/89776195
- https://ywnz.com/linuxyffq/6675.html
- https://www.jianshu.com/p/dfe717b09554
- https://www.wavelpc.com/blog/3735.html