× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Rsync using SSH

azzkiker
Aspirant

Rsync using SSH

Hello @ all,

i want to use my newly bought Readynas RN104 to Backup some of my data from a Synology Diskstation DS2413+.
To do this, i use rsync. The Readynas powers itself up, connects via rsync to Diskstation and copies newly modified files.

But now i like to change to a secure connection using SSH because i want to use internet for the task.
In the Web interface it's easy to select Rsync over SSH and export public rsa key.
I copied the public key to the Diskstation and tested SSH connection with keys on the console of the Readynas, which is working fine.
But i can't connect using Rsync. Again i tried using console and there seems to be a little problem with the connection path.
The Readynas saves the connection string like this: "xxx.xxx.xxx.xxx:/path" in the configuration file "/etc/frontview/backup_jobs.conf"
But the Diskstation wants to have a connection string like this: "xxx.xxx.xxx.xxx::path"
When creating a backup job not using SSH the connection string is correctly saved to "backup_jobs.conf", so it's clear why it is working with only using Rsync.
I did not find the module which is writing backup_jobs.conf. Can someone please tell me which file needs to be modified.
I'm not sure if the connection string the Diskstation wants or if the string the Readynas uses is the standard string. Possibly this can be updated in next firmware version.

Best regards
Jens
Message 1 of 13
mdgm-ntgr
NETGEAR Employee Retired

Re: Rsync using SSH

The path is different because of using Rsync over SSH.

Try copying files using scp and you'll see that paths are specified the same way.
Message 2 of 13
azzkiker
Aspirant

Re: Rsync using SSH

But when modifying the configuration for Rsync over SSH in "backup_jobs.conf" file it is working.
So in my opinion the Readynas does save the path different, not correct, to configuration file when using Rsync over SSH.
Message 3 of 13
mdgm-ntgr
NETGEAR Employee Retired

Re: Rsync using SSH

I guess you're probably right. Interesting.
Message 4 of 13
azzkiker
Aspirant

Re: Rsync using SSH

I re-checked the man page of rsync, see: "http://linux.die.net/man/1/rsync"
This page describes the the connection of a rsync daemon needs a connection string like this: ip-adress::path
Instead a remote-shell connection needs a connection string like this: ip-adress😕path

To get the correct connection string the rsync daemon needs, i modified the frontview javascrip source on my Netgear readynas 104.
Now it saves the connection string like i need it in the "backup_jobs.conf" file.
But my rsync connection over ssh is not working because my synology nas, i think, is asking for a password.
A connection of ssh directly via console using the command "ssh username@ip-adress" from radynas to synology nas is working flawless without any password questions.
So my configuration of RSA-keyfiles should be fine.
When sending the "rsync -avuz -e 'ssh -i keyfile' sourec_ip-adress::path //dest/path" i'm getting asked for a password. If i insert the correct password for "username" it will work.
But in automatic configured backup jobs i'm not asked for a password, the frontview has no popup-gui for this and it's also not practcable for backup-jobs. They should run without any user support.
I can add password to "backup_conf.jobs" file and it will work. But then the password is saved in cleartext, which i don't want.

In my opinion the guys from netgear should add some more configuration possibilities to the frontview gui.
Also the port could be made configurable like the people from this task wish to have:
"http://www.readynas.com/forum/viewtopic.php?f=124&t=74216"

Overall i'm not sure if the companies pay much attention on rsync implementation, because my netgear readynas 104 is not easy to configure
and also the synology doesn't offer a lot of information about rsync. It seems to me, both companies prefer the tell the customer to use their
own backup systems which are not usable with different device manufacturers.
The only solution for me is to learn more about linux and kep on trying. Which is also not bad because i improve my knowledge in using linux for future tasks.
Message 5 of 13
mdgm-ntgr
NETGEAR Employee Retired

Re: Rsync using SSH

Here is how Rsync over SSH was configured on the old models: http://kb.netgear.com/app/answers/detail/a_id/12263/~/setting-up-rsync-over-ssh

Depending on how you are using Rsync you might need to manually upload the public SSH key file to the NAS using SSH to get Rsync over SSH to work.
Message 6 of 13
azzkiker
Aspirant

Re: Rsync using SSH

My readynas 104 is completely different to configure.
But it seems, the rsync configuration on old models is more detailed.

On my readynas 104 i could easily read the public key with web-gui and insert it using
the console to my Synology nas.
But Synology doesn't offer the option to insert public keys using web admin. Or i was not able to find it.
The connection using ssh from readynas to synology nas is working fine without needing any password.
But "rsync+ssh" is not working and i don't find why rsync+ssh is asking for password.
Message 7 of 13
xeltros
Apprentice

Re: Rsync using SSH

to automate SSH login, the best option is to enable certificate authentication without password.
Another one would be to use expect in a script, I believe this could work. Both require to log in with SSH for configuration since the RN104 don't allow SSH configuration on the web interface but only ssh enable/disable.
By the way, Netgear keeps the option of denying support if SSH is enabled so if you run into trouble, depending on what problem you have and who you are working with they may require a factory reset.
Message 8 of 13
azzkiker
Aspirant

Re: Rsync using SSH

The automated login with certifcates is working when i only use "ssh username@ip-adress".
But it doesn't work with rsync. When starting rsync from command promot i get a password question. If i enter correct password for "username" everything works fine. When using gui i only get error and no password question. I believe my rsync command is wrong or my synology nas has some special configuration which will ask for password with rsync.
Message 9 of 13
xeltros
Apprentice

Re: Rsync using SSH

ssh user@host 'rsync -rtvu /source /dest'
this doesn't work and asks for a password ?
Message 10 of 13
azzkiker
Aspirant

Re: Rsync using SSH

yes, when i use your suggested command i get asked for a password.
Message 11 of 13
drewttt
Aspirant

Re: Rsync using SSH

I setup my DataBox to have passwordless SSH into my RN104 via public/private key. Once my DataBox was able to ssh in without being prompted for a password, this works to rsync the data without being prompted for a password:

rsync -av --delete /home/DataBox -e 'ssh -p 22' root@<readynas ip>:/data/Backup/DataBox
Message 12 of 13
azzkiker
Aspirant

Re: Rsync using SSH

I found some time to re-check my rsync connection using SSH.
This seems to be a different behaviour of the Synology NAS.
The rsync server is asking for a password, not the SSH (this works fine with the keys).

If i use the command "rsync -auvz -e 'SSH -v' Rsync@ip-adress:/volume1/path_to_the_synology-share /path_on_the_readynas" to connect from the Netgear Readynas to my Synology it is working.
If i replace the bold part with "/" it is not working and if i use ":" i get asked for a password from the rsync server because SSH is already working.
Message 13 of 13
Top Contributors
Discussion stats
  • 12 replies
  • 6284 views
  • 0 kudos
  • 4 in conversation
Announcements