本文主要梳理 rsync server 的基本配置与使用方式;
rsync server 的几个关键配置文件
- /etc/rsyncd.conf: 主配置文件;
- /etc/rsyncd.password/rsyncd.secrets: 秘钥文件;
- /etc/rsyncd.motd: rysnc 服务器元信息, 非必须;
其中, rsyncd.password 秘钥文件的掩码必须是 600:
1 2 3
| > ll /etc/ | grep rsyncd -rw-r--r-- 1 root root 361 Apr 6 2017 rsyncd.conf -rw------- 1 root root 24 Apr 6 2017 rsyncd.password
|
rsyncd.conf 配置说明
一个典型的 rsyncd.conf 文件如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| uid=nobody gid=nobody
user chroot = no
max connections = 200 timeout = 600
pid file = /data1/trans_file/rsyncd.pid lock file = /data1/trans_file/rsyncd.lock log file = /data1/trans_file/rsyncd.log
secrets file = /etc/rsyncd.password
dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
[wireless_log]
auth users = sync path = /data1/trans_file/files/wireless_log ignore errors
read only = no
list = no
|
rsyncd.password / rsyncd.secrets 配置说明
以 :
分隔, 用户名和密码, 每行一个:
1 2
| user1:password1 user2:password2
|
rsyncd 启动方式
1 2
| sudo /usr/bin/rsync --daemon --config=/etc/rsyncd.conf
|
参考链接