rsyncd配置

一、Server端

1、确认rsync已经安装

2、配置文件

# cat /etc/rsyncd.conf
gid = users
read only = yes 
use chroot = true
transfer logging = true
log format = [transfer info] %a %u %m %f %o %b
log file = /var/log/rsyncd.log # log文件
pid file = /var/run/rsyncd.pid
port = 33302 # 监听端口

[fabledata] # 定义同步的模块名
path = /data/fabledata # 模块名对应的路径
comment = tc_data_ftp
auth users = sync # 用于同步的用户
secrets file = /etc/rsyncd.secrets # 用于存储用户&密码的文件
uid = sync # 用于同步的虚拟用户
gid = users
read only = no # 是否只读

3、启动服务

/usr/bin/rsync --address 10.10.10.10 --daemon --config=/etc/rsyncd.conf

4、密码文件

a)密码文件的格式:
sync:password

b)权限

chmod 600 /etc/rsyncd.conf

c)属主
文件属于与启动rsync服务进程的用户保持一致;

二、Client端

1、同步命令格式

rsync -avz --password-file=/etc/rsyncd.pass --port=33302 testfile sync@10.10.10.10::fabledata/tmp

2、密码文件权限

chmod 600 /etc/rsyncd.pass

3、密码文件内容(仅存储密码)

cat /etc/rsyncd.pass
password

 

 

posted @ 2018-07-24 09:47  j1jack  阅读(125)  评论(0)    收藏  举报