Wednesday, August 17, 2016

RSYNC with Username And Password


Destination:

vim /etc/rsyncd.conf

With content:
[logdir]
path=/home/vnk002/logdir/
comment = rync log
uid = root
gid = root
read only = no
list = yes
auth users = vnk002
secrets file = /etc/rsyncd.secrets
max connections = 10
hosts allow = 123.123.123.101

vim /etc/rsyncd.secrets
vnk002:PaSSWD
chmod 600 /etc/rsyncd.secrets

Start RSYNC as Daemon
rsync --daemon

Sources:
Create a file name and store only the password
cat /home/vnk001/.rsync
PaSSWD

chmod 600 /home/vnk001/.rsync
chown vnk001:vnk001 /etc/.rsync

rsync -avz --password-file=/home/vnk001/.rsync /home/vnk001/logdata/ vnk002@123.123.123.203::logdir

No comments:

Post a Comment