rsync

软件包安装

  # sudo apt-get  install  rsync  注:在debian、ubuntu 等在线安装方法;
  # yum install rsync    注:Fedora、Redhat 等在线安装方法;
  # rpm -ivh rsync       注:Fedora、Redhat 等rpm包安装方法;

配置

/etc/rsyncd.conf

uid = root
gid = root
use chroot = yes
max connections = 4
pid file = /var/run/rsyncd.pid
port 873
# exclude = lost+found/
# transfer logging = yes
# timeout = 900
# ignore nonreadable = yes
# dont compress   = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2

# [ftp]
#        path = /home/ftp
#        comment = ftp export area
[AAA]
path = /xx/xx/xxxxxxx/
comment = rsync files             ## 注释
ignore errors                 ##忽略IO
read only = no
list = yes
auth users = rsync
secrets file = /etc/rsync.passwd
[BBB]
path = /xx/xx/xxxx/
comment = rsync files             ## 注轇~J
ignore errors                 ##忽潕¥IO
read only = no
list = yes
auth users = rsync
secrets file = /etc/rsync.passwd
 

密码

/etc/rsync.passwd

格式  账号:密码

chown root.root rsync.passwd

chmod 600 rsync.passwd

 

启动rsync服务器相当简单,有以下几种方法

  A、--daemon参数方式,是让rsync以服务器模式运行

  #/usr/bin/rsync --daemon  --config=/etc/rsyncd/rsyncd.conf  #--config用于指定rsyncd.conf的位置,如果在/etc下可以不写

  B、xinetd方式

  修改services加入如下内容
  # nano -w /etc/services

  rsync  873/tcp  # rsync 
  rsync  873/udp  # rsync

  这一步一般可以不做,通常都有这两行(我的RHEL4和GENTOO默认都有)。修改的目的是让系统知道873端口对应的服务名为rsync。如没有的话就自行加入。

  设定 /etc/xinetd.d/rsync, 简单例子如下:

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

  上述, 主要是要打开rsync這個daemon, 一旦有rsync client要连接時, xinetd会把它转介給 rsyncd(port 873)。然后service xinetd restart, 使上述设定生效.

 

 

最后添加防火墙的端口就部署完毕了

转载于:https://my.oschina.net/u/3677090/blog/1552018

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值