rsync

服務端
useradd rsync -s /sbin/nologin -M
mkdir /rsync
chmod rsync.rsync /rsync
cat << EOF >> /etc/rsyncd.conf
pid file = /var/run/rsyncd.pid
port = 873
uid = rsync
gid = rsync
use chroot = no
read only = no
max connections = 5
log file = /var/log/rsync.log
lock file=/var/run/rsync.lock
log format = %t %a %m %f %b
timeout = 300
list=yes
ignore errors
comment = test
secrets file =/etc/rsync.password
read only = no
hosts allow = 192.168.189.0/24
auth users = qizhk
[rsync]   
path = /rsync
EOF
echo 'qizhk:123456' > /etc/rsync.password
chmod 600 /etc/rsync.password
/usr/bin/rsync --daemon
echo '/usr/bin/rsync --daemon' >> /etc/rc.local

客戶端
rsync -zva /backup/ [email protected]::qizhk/ --password-file=/etc/rsync.pas

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章