您的位置:首页 > 其它

Rsync安全配置

2015-09-28 16:06 531 查看
创建rsync的密码文件,格式
username:password

$ vi /etc/rsyncd.secrets


创建rsync共享配置文件
$ vi /etc/rsyncd.conf


添加如下内容:

pid file = /var/run/rsyncd.pid

port = 873

uid = root

gid = root

use chroot = yes

read only = no

max connections = 1000

secrets file=/etc/rsyncd.secrets

#This will give you a separate log file

log file = /var/log/rsync.log

log format = %t %a %m %f %b

syslog facility = local3

timeout = 300

#For ACL

hosts allow = 10.0.0.0/255.0.0.0

hosts deny = *

[transcode]

path=/home/test

read only = no

uid=root

gid=root

auth users = root

启动rsync server:rsync --daemon /etc/rsyncd.conf

用法:rsync -rvaq --password-file=/data/secret.txt --delete --exclude "*.pyc" --exclude ".git" username@ip:transcode/test.txt .

注意事项:本机上的/data/secret.txt文件里只需要保存密码即可,用户名已经在命令中有了,并且权限应为600。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: