簡單設定rsync服務

來源:互聯網
上載者:User

簡單設定rsync服務  有時候需要給其它部門提供遊戲或者網站某些日誌,這時候可以給他們伺服器帳號自己ssh擷取,但為安全方面考慮,還是用rsync配置模組為好,這樣除了檔案傳輸,不然有其它安全方面的問題。  大多linux系統都內建rsync,配置如下:  /etc/rsyncd.conf uid = rootgid = rootstrict modes = yesmax connections = 3600use chroot = nolog file = /var/log/rsyncd.log  #定義一些rsync檔案的目錄pid file = /var/run/rsyncd.pidlock file = /var/run/rsyncd.lock [datalog]       #模組名path=/home/datalog  #需同步的目錄ignore errors       #忽略一些錯誤read only = yes      #只有讀取許可權auth users = datacenter #是否需要認證使用者,不填以下兩行,只預設匿名secrets file = /etc/rsyncd.pass  密碼檔案的格式為user:pass,如cat /etc/rsyncd.pass datalog:datalog1234  注意,密碼檔案 /etc/rsyncd.pass許可權一定要設定為600許可權(chown root:root /etc/rsyncd.pass && chmod 600 /etc/rsyncd.pass )  設定好之後,開啟rsync服務(rsync服務預設用873連接埠,注意開放防火牆)  /usr/bin/rsync --daemon   此時在其它伺服器可以遠程通過rsync用戶端同步剛剛設定好的那個模組內容。  rsync -artuz -R    --port=873 datalog@192.168.1.1::datalog ./  按提示輸入密碼。  或者可以在用戶端也弄個密碼檔案, cat /etc/rsync.passdatalog1234  注意許可權也只能為600,然後執行命令直接同步處理檔案。  rsync -artuz -R --password-file=/etc/rsync.pass   --port=873 datalog@113.107.161.10::datalog ./ 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.