# yum install xinetd
「disable = yes」を「disable = no」へ変更
# vi /etc/xinetd.d/rsync -------------------------------------- # default: off # description: The rsync server is a good addition to an 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 }
アクセス許可のネットワークを記述する。
# vi /etc/hosts.allow rsync : 127.0.0.1 : allow rsync : 192.168.11. : allow
# /etc/init.d/xinetd start # chkconfig xinetd on
※hosts allowを複数書きたい時は、スペースで区切る
# cat /etc/rsyncd.conf log file=/var/log/rsyncd.log secrets file=/etc/rsyncd.secrets hosts allow = 38.99.89.185/32 192.168.10.0/24 hosts deny = * transfer logging = true auth users = backup list = true uid = root gid = root [www] comment = html contents path = /var/www
# cat /etc/rsyncd.secrets backup:xxbackup
ポート変更する場合、xinetdでは上げられないのでrsyncデーモンだけで上げる。
# rsync --daemon --config=/etc/rsyncd.conf --port=10873
# cat /etc/rsyncd.pass xxbackup
# rsync -av --password-file=/etc/rsyncd.pass rsync://back@nagi01.hsinc.com/www /home/backups/nagios/
# rsync -av --port=10873 --password-file=/etc/rsyncd.pass rsync://back@nagi01.hsinc.com/www /home/backups/nagios/