歡迎您光臨本站 註冊首頁

rsync 服務與配置文檔

←手機掃碼閱讀     火星人 @ 2014-03-08 , reply:0

rsync 服務與配置文檔

1 某項目rsync配置文檔(關鍵字已處理)

$ cat /etc/rsyncd.conf

  1. #全局配置
  2. log file = /var/log/rsyncd.log #日誌文件
  3. pid file = /var/run/rsyncd.pid #pid文件
  4. lock file = /var/run/rsync.lock #支持max connections參數的鎖文件
  5. max connections = 100 #客戶端最大連接數為100
  6. use chroot = no #不使用chroot !!
  7. uid = dongnan #伺服器端傳輸文件時,要發哪個用戶和用戶組來執行;
  8. gid = dongnan ###默認是nobody 用戶和用戶組
  9. ignore errors #忽略一些無關的IO錯誤
  10. list = no #不允許列文件
  11. #address = 10.0.100.71 #監聽的ip地址與埠號
  12. #port = 873
  13. motd file = /etc/rsyncd/rsyncd.motd #定義伺服器信息,用戶登錄時會看到這個信息
  14. #模塊配置
  15. [htdocs] #模塊名稱
  16. path = /data/htdocs/ #指定目錄
  17. comment = htdocs #註釋
  18. read only = yes #只讀
  19. auth users = dongnan #基於用戶認證,如果沒有這行則是匿名,多個用戶用","分隔
  20. secrets file = /etc/rsyncd.secrets #保存用戶密碼,格式如下 cat /etc/rsyncd.secrets
  21. ### dongnan:654321
  22. [iso]
  23. path = /data/iso/
  24. comment = iso
  25. read only = no #可寫
  26. hosts allow = 10.0.100.0/24 #基於IP地址認證,多個IP地址用空格" "分隔

2 啟動 rsync 服務

  1. rsync --daemon

3 rsync 協議與埠

  1. $ grep -iE '^rsync' /etc/services
  2. rsync 873/tcp # rsync
  3. rsync 873/udp # rsync

4 驗證 rsync 服務

  1. $ lsof -i :873
  2. COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
  3. rsync 24683 root 3u IPv6 1568026 TCP *:rsync (LISTEN)
  4. rsync 24683 root 5u IPv4 1568027 TCP *:rsync (LISTEN)
  5. rsync 27218 dongnan 4u IPv4 1584387 TCP 192.168.57.71:rsync->192.168.6.150:35444 (ESTABLISHED)
  1. $ rsync -avzP perl 192.168.57.71::data/
  2. rsync server for 10.0.100.0/24 or 192.168.57.0/24
  3. building file list ...
  4. 2 files to consider
  5. sent 82 bytes received 16 bytes 196.00 bytes/sec
  6. total size is 368 speedup is 3.76



參考
http://os.51cto.com/art/201006/203217.htm
http://www.centos.bz/2011/06/rsync-server-setup/


http://www.ibm.com/developerworks/cn/linux/l-cn-chroot/

結束
rsync 模塊配置靈活,基於IP地址認證或者基於用戶認證,可以根據實際需求配置.

 

本文出自 「dongnan」 博客,請務必保留此出處http://dngood.blog.51cto.com/446195/826632


[火星人 ] rsync 服務與配置文檔已經有430次圍觀

http://coctec.com/docs/linux/show-post-45981.html