安装rsync

apt-get install rsync

设置开机启动

sed -i "s|^RSYNC_ENABLE=.*|RSYNC_ENABLE=true|" /etc/default/rsync

配置rsyncd.conf内容

cat > /etc/rsyncd.conf << EOF
uid = nobody
gid = nobody
use chroot = yes
syslog facility = local5
pid file = /var/lock/rsync.lock
[data]
        path = /data 
        read only = false 
        write only = false
        list = true
#[data]//用户名认证
        #path = /test    
        #read only = false
        #write only = false
        #list = true
        #auth users = rsync        
        #secrets file = /etc/rsyncd.secrets
EOF

服务管理

systemctl restart rsync

详细参数说明

https://download.samba.org/pub/rsync/rsyncd.conf
最后修改:2025 年 06 月 10 日
如果觉得我的文章对你有用,请随意赞赏