Home | Mirror | Search

2. rsync

yum install xinetd rsync -y
		
		
vim /etc/xinetd.d/rsync <<VIM > /dev/null 2>&1
:%s/yes/no/
:wq
VIM
		
		
		
cat > /etc/rsyncd.conf <<EOD
uid = root
gid = root
use chroot = no
max connections = 8
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log

hosts deny=*
hosts allow=192.168.2.0/255.255.255.0

[www]
    uid = www
    gid = www
    path = /www/www.example.com
    ignore errors
    read only = no
    list = no
    auth users = neo
    secrets file = /etc/rsyncd.passwd
[images]
    uid = www
    gid = www
    path = /www/images.example.com
    ignore errors
    read only = no
    list = no
    auth users = neo
    secrets file = /etc/rsyncd.passwd

EOD

# chmod 600 /etc/rsyncd.*
		
		
# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
		

例 3.1. /etc/rsyncd.conf

			
cat > /etc/rsyncd.conf <<EOD
uid = root
gid = root
use chroot = no
max connections = 8
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log

hosts deny=*
hosts allow=192.168.2.0/255.255.255.0

[www]
    uid = www
    gid = www
    path = /www
    ignore errors
    read only = no
    list = no
    auth users = www
    secrets file = /etc/rsyncd.passwd
EOD
			
			
			
cat > /etc/rsyncd.passwd <<EOD
www:eF9nJCcGKJPsiqZsfjGXxwfF41cLibTo
EOD
			
			
chmod 600 /etc/rsyncd.passwd
			

comments powered by Disqus