Centos6.6 install rsync server, centos6.6rsync
I. Introduction
Rsync is often used for code distribution or data backup at work. The configuration is not complex and only recorded. The installation environment is as follows:
1) Centos6.6
2) rsync-3.0.6-12.el6.x86_64
3) Server IP: 192.168.19.128; Client IP: 192.168.19.145
Ii. Installation
$ Yum install-y rsync xinetd
$ Setenforce 0 or echo "SELINUX = disabled">/etc/selinux/config (it takes effect only after restart)
Ii. Configuration
$ Vi/etc/Rsyncd. confUid = root # transfer files with the specified UID gid = root # transfer files with the specified GID # hosts allow = 10.50.53.100 # allow access from the specified host # hosts deny = 0.0.0.0/32 # block specified host access use chroot = yes max connections = 10 # maximum number of allowed connections pid file =/var/run/rsyncd. pid # specify the pid file path lock file =/var/run/rsync. lock # specify the process lock file log file =/var/log/rsyncd. log # specify the log path timeout = 600 # connection timeout port = 873 # specify the tcp port [backup] path =/datacomment = rsync filesread only = nolist = yesauth users = chicken00secrets file =/ etc /. rsyncd. secrets
# Set the user name and password. The user name is the same as that specified in the configuration file (auth users)
$ Echo "chicken00: chicken00">/Etc/. rsyncd. secrets
# File permissions must be set to 600
$ Chmod 600/etc/. rsyncd. secrets
3. Start
# Set to boot$ Chkconfig rsync on# Viewing startup$ Chkconfig--List rsyncRsync on # Content in xinetd configuration of rsync daemon$ Cat/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 = noflags = IPv6socket_type = streamwait = nouser = rootserver =/usr/bin/rsyncserver_args = -- daemonlog_on_failure + = USERID}
# Start the service
$/Etc/init. d/xinetd start
Iv. Check
# Enable Firewall
V. Client synchronization test
$ Echo "chicken00">/etc/. rsyncd. secrets $ chmod 600/etc/. rsyncd. secrets $ echo 'Hello rsync !! '> Hello.txt
# Uploading files
$ Rsync-vzrtopg -- delete -- progress hello.txt chicken00@192.168.19.128: backup -- password-file =/etc/. rsyncd. secrets
# Check whether the file is synchronized on the server.
# Download
$ Rsync-vzrtopg -- delete -- progress chicken00@192.168.19.128: backup $ (pwd)/backup-$ (date + % Y-% m-% d) -- password-file =/etc /. rsyncd. secrets