目录
下载
https://syncthing.net/downloads/
mkdir syncthing
cd syncthing/
wget https://github.com/syncthing/syncthing/releases/download/v1.19.1/syncthing-linux-amd64-v1.19.1.tar.gz
安装
解压并安装
tar -xvf syncthing-linux-amd64-v1.19.1.tar.gz
cd syncthing-linux-amd64-v1.19.1/
cp syncthing /usr/local/bin/
配置启动文件
cd etc/linux-systemd/system/
cp [email protected] [email protected]
vim [email protected]
按i
键进入编辑模式,然后把第10行修改一下
原始:
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
User=%i
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
ProtectSystem=full
PrivateTmp=true
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
即把ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0
这一行里面的/usr/bin/syncthing
改为/usr/local/bin/syncthing
然后按wq
保存并退出
cp [email protected] /etc/systemd/system
先启动一次,生成默认配置文件
syncthing
修改Syncthing配置文件
cd /root/.config/syncthing/
cp config.xml config.xml.bk1
vim config.xml
把监听地址127.0.0.1:8384
改为0.0.0.0:8384
即可
启动Syncthing
systemctl enable [email protected]
systemctl start [email protected]
防火墙放行三个端口
22000|21027/udp
8384/tcp
然后打开http://ip:8384/
就可以详细配置了
参考:
https://docs.syncthing.net/users/config.html
https://docs.syncthing.net/users/autostart.html#using-systemd
2 条评论 “Linux Ubuntu 20.04 下安装并配置 Syncthing”
It’s a pity you don’t have a donate button! I’d definitely donate to this outstanding blog!
I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account.
I look forward to new updates and will talk about
this website with my Facebook group. Chat soon!
I all the time emailed this blog post page to all my contacts,
for the reason that if like to read it then my friends will too.