open rsyncd server

安裝rsync 是必須的!

apt-get install rsync

要修改兩個設定檔 /etc/default/rsync, /etc/rsyncd.conf, 還有密碼檔 /etc/rsync.secrets 設定開機 init 啟動

vi /etc/default/rsync
RSYNC_ENABLE=true

接著修改rsyncd

vi /etc/rsyncd.conf
[backup]
path = /home/backup
hosts allow = 192.168.0.1
hosts deny = *
list = true
auth users = user
uid = root
gid = root
secrets file = /etc/rsyncd.secrets
read only = false

修改密碼檔

vi /etc/rsyncd.secrets
user:password

設定檔案權限

chmod 600 /etc/rsyncd.secrets

記得確認目錄有在

mkdir /home/backup

啟動 rsync 大功告成

/etc/init.d/rsync start
Starting rsync daemon: rsync.

reference: http://www.server-world.info/en/note?os=Debian_7.0&p=rsync

Comments