码迷,mamicode.com
首页 > 其他好文 > 详细

Rsync 服务器端配置

时间:2015-06-09 09:41:26      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:

Centos 6.3 已经自带Rsync服务

安装xinetd

# yum -y install xinetd

编辑/etc/xinetd.d/rsync文件,把disable = yes修改为disable = no

技术分享
# default: off
# description: The rsync server is a good addition to an ftp server, as it #       allows crc checksumming etc.
service rsync
{
        disable = no
        flags           = IPv6
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/bin/rsync
        server_args     = --daemon
        log_on_failure  += USERID
}
rsync

启动Xinetd

# /etc/init.d/xinetd start

编辑/etc/rsyncd.conf,设置Rsync服务

# vi /etc/rsyncd.conf

技术分享
max connections = 2
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
timeout = 300

[down] #模块名
        comment = Web Files Sync
        path = /home/website.com/public_html #同步目录
        ignore errors
        read only = yes #只读,禁止客户端修改
        list = yes
        uid = nobody
        gid = nobody
        auth users = DownSync #允许连接的用户名
        secrets file = /etc/rsyncd.secrets #密码文件
        hosts allow = 192.99.0.0/255.255.0.0         #允许连接的网段,新增服务器后, 需要把新服务器的网段加入,不然无法进行同步
[upload]
        comment = Web Files Upload
        path = /home/website.com/public_html
        ignore errors
        read only = false
        list = yes
        uid = root
        gid = root
        auth users = UploadSync
        secrets file = /etc/rsyncd.secretsup
rsyncd.conf

编辑密码文件

# vi /etc/rsyncd.secrets

DownSync:Password#用户名:密码

给密码文件加上正确的权限

# chmod 600 /etc/rsyncd.secrets

 

Rsync 服务器端配置

标签:

原文地址:http://www.cnblogs.com/Mrhuangrui/p/4562556.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!