In those years I stepped pit of the rsync daemon Detailed

Server settings

/etc/rsyncd.conf settings

#rsync.conf--------------------------------------------start

This place in the tank ## through a similar error message uid rsync error
## because the annotation is added to the uid = ## behind the rsync, users of the system defined herein, after the configuration file ## must wrap comment added
uid = the rsync
GID the rsync =
use CHROOT = NO
max = 200 is Connections
timeout = 300

## This new version will be added, otherwise an error common to see the following error
Fake Super = yes
pid = File /var/run/rsyncd.pid
## Lock File
Lock File = /var/run/rsync.lock
log File = / var / log / rysncd.log

[backup]

## that is receiving the catalog file, at the end of a clear distinction between / problems
path = / Backup
the ignore errors
the Read only = false
List = false
## production environment in general use within the IP network to do rsync
hosts the allow = 172.16.1.0/24
hosts deny = 0.0 .0.0 / 32

## This is the user name of the client access, that is the name rsync_backup @ IP
auth users = rsync_backup

## each similar to the [backup] This module has a password file, distinguished path in the late establishment of multi-module, and can customize
Secrets File = /etc/rsync.password
# rsyncd.conf ------- ------------------------------------------- end

Add system users and consistent with rsyncd.conf uid gid

useradd -s /sbin/nologin -M rsync

Add password file and modify the permissions to 600

echo "rsync_backup:123" >> /etc/rsync.password
chmod 600 /rsync.password

Create a directory to receive the file and modify the owner and all groups

mkdir -p /backup
chown rsync.rsync /backup

Client Configuration

Create a password file and write password and modify permissions

echo "123" >> /etc/rsync.password
chmod 600 /etc/rsync.password

test

1. Make sure the server ports open by default with 873 nmap telnet and other tests, if not normal, high probability is a firewall issue
2. command rsync -avz / backup / testfile [email protected] :: backup Note daemon mode with :: two colons, shell model by: a colon

This command is very important to write the script when the non-interactive use a password file

rsync -avz /backup/testfile [email protected]::backup --passwork-file=/etc/rsync.password

Common Errors

1.uid gid error: user name wrong, wrong configuration file (I just followed the ## notes in the tank for a long time)
2. configuration file written several file name, be sure to check the contents of the configuration file and the actual file is created name consistent
3.rsync: chgrp ".hosts.G6sZha" (in backup) failed: Operation not permitted (1)
mistake because it did not add fake super = yes

Guess you like

Origin blog.51cto.com/14316149/2415177