Skip to content

Instantly share code, notes, and snippets.

@ChinaXing
Last active December 20, 2015 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChinaXing/6051198 to your computer and use it in GitHub Desktop.
Save ChinaXing/6051198 to your computer and use it in GitHub Desktop.
rsync 非root用户运行配置

server端配置

#假设为admin用户,主机A为server端

  1. rsyncd.conf 配置文件

     max connections = 4
     syslog facility = local5
     pid file = /tmp/_rsyncd.pid
     lock file = /tmp/_rsyncd.lock
     [admin]
     path = /home/admin/
     uid = admin
     gid = admin
     use chroot = no
    

注:最后一句为关键,指定不使用chroot,因为非root用户没有权限

  1. 运行启动daemon

rsync --daemon --port 9988

client端

  1. 在另一台主机B上进行测试

rsync -av rsync://A:9988/admin .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment