Server Configuration:
1. Install xinetd and modify the rsync configuration.
A. Yum install xinetd
B. VI/etc/xinetd. d/rsync
Service rsync {disable = No # change Yes to no flags = IPv6 socket_type = stream wait = no user = root server =/usr/bin/rsync server_args = -- daemon log_on_failure + = userid}
C./etc/init. d/xinetd start
D. Vim/etc/rsyncd. conf
Add content (delete NOTES)
Port = 873 port number uid = nobody user gid = nobody user group user chroot = nomax connections = 200 timeout = 600pid file =/var/run/rsyncd. pidlock file =/var/run/rsyncd. locklog file =/var/log/rsyncd. log [test] Module name Path =/www/test corresponding directory ignore errorsread only = nolist = noauth users = rootsecrets file =/etc/rsyncd. secrets Password File
E. VI/etc/rsyncd. Secrets: Write the password file and change the file to read-only
root:123456789
F. Create a directory and modify the file owner
Mkdir/www/test
Chown Nobody. Nobody-r/www/test
G. Start the service
Rsync -- daemon
Client Configuration:
A. Rsync is installed on the client by default. If not, install Yum install rsync on your own.
B. Create a password file
Vim/etc/rsyncd. passwd
123456789
C. Set the password file to read-only
Chmod 600/etc/rsyncd. passwd
Run the test:
Pull/usr/bin/rsync-avz -- Progress -- password-file =/etc/rsyncd from the server. passwd [email protected]: Test/www/test server push/usr/bin/rsync-avz -- Progress -- password-file =/etc/rsyncd. passwd/www/test [email protected]: Test
Simple configuration of rsync push