rsync工具簡介
# default: off
# description: The rsync server is a good addition to am ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = yes 修改爲disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
編輯/etc/rc.d/rc.local,在最後添加:
/usr/local/bin/rsync –daemon
max connections = 9 #最大連接數
list = yes #允許列出文件清單
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
path = /var/www/html/ #發佈的路徑
ignore errors
read only = yes #只讀
auth users = backup #認證用戶爲root
secrets file = /etc/sery.pass #密碼文件
backup:123456
root 27284 1 0 10:26 ? 00:00:00 rsync –daemon –config=/etc/rsyncd.conf
root 30516 29986 0 18:35 pts/3 00:00:00 grep rsync
kill -9 27284
rsync –daemon –config=/etc/rsyncd.conf
123456 #這裏只需要輸入服務器端密碼文件中定義的密碼即可。
@ERROR: auth failed on module ***
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
- 服務器密碼文件 /etc/rsyncd.secrets 格式爲: username:password
- 客服端密碼文件 password.rsync 格式爲:password
continuing without password file
- 服務器密碼文件 /etc/rsyncd.secrets 權限爲600: chmod 600
- 客服端密碼文件 password.rsync 權限爲600:chmod 600