Help with rsyncd.conf and rsnapshot

Discussion on remote replication.
Post Reply
jfk105
Getting the hang of things
Posts: 67
Joined: Fri Nov 13, 2009 4:00 pm

Help with rsyncd.conf and rsnapshot

Post by jfk105 »

Hello,
I'd like to backup a share folder from a NAS called SOURCE (ts-253) with ip 192.168.200.219 to a second nas called BACKUP (ts-253 too) with ip 192.168.200.193. So BACKUP could "pull" the data from SOURCE.
So I've installed rsnapshot on nas BACKUP (192.168.200.193) and set snaphoot root and backup path. Backup path is : backup rsync://192.168.200.219/DATA SHARE/
I've enbled rsync users on both nas with same password.
On NAS SOURCE on share folder DATA I've assigned R/W permission also to rsync user.
I've tried my rsnapshot with "rsnapshot configtest" and syntax is OK so then I try a test with "rsnapshot - V daily" but after it creates the root folders on BACKUP called daily.0 it prompts for a password (I try with admin and rsync password but no luck) it reports always "@ERROR: auth failed on module DATA" so I guess is a permission problem... but lookin @ /etc/config/rsyncd.conf on SOURCE NAS I can't to set right permission to access on it correctly.
My rsyncd.conf is this: Some commented lines are mine modification.

uid = nobody
gid = nogroup
#pid file = /var/run/rsyncd.pid
#read only = true
hosts allow = *
port = 873

SLimitRate =
RLimitRate =

[Web]
path = /share/CACHEDEV1_DATA/Web
[Public]
path = /share/CACHEDEV1_DATA/Public
[printers]
path = /var/spool/smb
[homes]
path = /share/CACHEDEV1_DATA/homes
[home]
path = %H
[DATA]
path = /share/CACHEDEV1_DATA/DATA
#this last path line is what I need to read and backup
--------------
I've tried with uid=admin and gid=administrators, uid=rsync and gid=administrators, uid=rsync and gid=rsync but always same issue.
I have other nas and their work pulling from linux server (not nas box) so I guess I miss something on NAS SOURCE.
I don't know which uid and gid give and if need some other modifications.
After each modification I always restart rsyncd service...
Can you help me please?
Thanks in advance
J
Jfk
Milano, Italy
Qnap TS-251+ -2G :https://www.qnap.com/i/useng/product/model.php?II=195
2 * Western Digital WD30EFRX WD Reds (RAID1) - FW: QTS 4.4.1.1081 2019/10/05
jfk105
Getting the hang of things
Posts: 67
Joined: Fri Nov 13, 2009 4:00 pm

Re: Help with rsyncd.conf and rsnapshot

Post by jfk105 »

I stepped forward.
I've read a guide ("viewtopic.php?f=22&t=13025#p63191") to "Enabling key-based authentication" on Nas to avoid access denied from backup nas to source nas. So after I did the next command on my backup nas:
scp ~/.ssh/id_rsa.pub admin@192.168.200.219:~/.ssh/authorized_keys (Ip 192.168.200.219 is the ip of SOURCE nas).
This command works correctly after prompts for SOURCE admin password and reports: id_rsa.pub 100% 395 235.4KB/s 00:00
so public SSH keys are copied from BACKUP NAs onto SOURCE nas correctly.

UPDATE:
RSYNC CAN'T ACCESS TO PULL DATA also with public SSH keys copied from BACKUP to SOURCE...
So Before working on problem after reboot (because I've problem without a reboot) I keep continue searching solution to prompt password with rsnapshot...
After many tests ( I've reset the nas too unluckily) Rsnapshot keep asking a password to make its job but I try with all password I have (admin,rsync) without a rsync worked...
Now after some hours I've tried to change rsync user on SOURCE nas giving to rsync user the name "admin" (and his relative password). So ...
Rsnapshot prompts again for password but admin's password for rsync user works and data are copied on BACKUP NAS..
Now I have to avoid prompted password and automate but I don't know what I have to do...
I re-tried with scp ~/.ssh/id_rsa.pub admin@192.168.200.219:~/.ssh/authorized_keys (Ip 192.168.200.219 is the ip of SOURCE nas). but no luck.
It's obviously a user/password access denied but I can't modify on SOURCE NAS these parameters...

------------------------------------------------
Now I the PDF guide continues:

"set the correct access permissions on the configuration folder in the
SOURCE NAS, otherwise the key-based authentication won't work and I'll get an 'access denied (public
key)' error or password challenge when your backup NAS tries to login. The problem is the folder
permissions get reset when the NAS is rebooted .

However, there is a special file on your QNAP that can be used to run
commands on startup. We are going to use it to restore our changes to the folder permissions on start up
(reboot). Login to your *target* NAS by SSH and open the autorun.sh file:
THESE LINES REFERS TO SOME MODELS x86 QNAP NAS (models TS-439, TS-509, TS-639, TS-809, TS-809U).

nano /tmp/config/autorun.sh
Add the following three lines to the file, then save it:
mount -t ext2 /dev/sdx6/tmp/config
chown admin.administrators /mnt/HDA_ROOT/.config
umount /tmp/config

But I need to use for TS-253A (64bit) so I can't find right commands to write on line "mount -t ext2 /dev/sdx6/tmp/config"
Can you help me please?
Thanks in advance
J
Jfk
Milano, Italy
Qnap TS-251+ -2G :https://www.qnap.com/i/useng/product/model.php?II=195
2 * Western Digital WD30EFRX WD Reds (RAID1) - FW: QTS 4.4.1.1081 2019/10/05
User avatar
OneCD
Guru
Posts: 12038
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: Help with rsyncd.conf and rsnapshot

Post by OneCD »

jfk105 wrote:But I need to use for TS-253A (64bit) so I can't find right commands to write on line "mount -t ext2 /dev/sdx6/tmp/config"
This may help you: viewtopic.php?f=45&t=130345

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
jfk105
Getting the hang of things
Posts: 67
Joined: Fri Nov 13, 2009 4:00 pm

Re: Help with rsyncd.conf and rsnapshot

Post by jfk105 »

Thanks for advice, I'll go to see. But before I need to solve rsync issue :
So Before working on problem after reboot (because I've problem without a reboot) I keep continue searching solution to prompt password with rsnapshot...
After many tests ( I've reset the nas too unluckily) Rsnapshot keep asking a password to make its job but I try with all password I have (admin,rsync) without a rsync worked...
Now after some hours I've tried to change rsync user on SOURCE nas giving to rsync user the name "admin" (and his relative password). So ...
Rsnapshot prompts again for password but admin's password for rsync user works and data are copied on BACKUP NAS..
Now I have to avoid prompted password and automate but I don't know what I have to do...
I re-tried with scp ~/.ssh/id_rsa.pub admin@192.168.200.219:~/.ssh/authorized_keys (Ip 192.168.200.219 is the ip of SOURCE nas). but no luck.
It's obviously a user/password access denied but I can't modify on SOURCE NAS these parameters...
Thanks, J
Jfk
Milano, Italy
Qnap TS-251+ -2G :https://www.qnap.com/i/useng/product/model.php?II=195
2 * Western Digital WD30EFRX WD Reds (RAID1) - FW: QTS 4.4.1.1081 2019/10/05
Post Reply

Return to “Remote Replication/ Disaster Recovery”