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

Re: Rsync over SSH to Digital Ocean Droplet

ArchPrime
Guide

Rsync over SSH to Digital Ocean Droplet

Hi, when stting up a backup job I am struggling to get my Ultra6 to connect to my remote Digital Ocean Droplet , so it can download ald locally store backups from there.

 

I have added the SSH public key given to me by ReadyNAS to Digital Ocean SSH keys (copy-pasting in to the 'add new SSH key dialog in Digital Ocean Dashboard from the publick key  txt file that ReadyNAS generated)  and have given that key the name 'ReadyNAS' (just for originality)

When  in ReadyNAS backup I then try to connect to the domain on the host, using method Rsync over SSH, and username 'ReadyNAS', I always get error:

 

Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.3]

 

I have tried using the server IP address rather than domain as the source, and using username 'root', and even powercycling the server - but none of these seemed to help.

 

What might I be doing wrong?

 

*** Edit

Logging in to server via SSH using PuTTy, to check if SSH service is running using:

sudo service ssh status

I can see my connection attempts, but that a different port is being tried each time, and none of these are the port 22 I actually set in ReadyNAS.

 

Jan 21 06:53:57 nz sshd[3628]: Connection closed by invalid user ReadyNAS (my ReadyNAS static IP) port 40214 [preauth]
Jan 21 06:53:58 nz sshd[3653]: Invalid user ReadyNAS from (my ReadyNAS static IP) port 40216
Jan 21 06:53:59 nz sshd[3653]: Connection closed by invalid user ReadyNAS (my ReadyNAS static IP) port 40216 [preauth]

etc

 

Does this offer any clues?

Model: ReadyNAS-Ultra 6|ReadyNAS-Ultra 6
Message 1 of 7
StephenB
Guru

Re: Rsync over SSH to Digital Ocean Droplet


@ArchPrime wrote:

I can see my connection attempts, but that a different port is being tried each time, and none of these are the port 22 I actually set in ReadyNAS.

I think you are seeing the source port in the status, and not the destination port.

 


@ArchPrime wrote:

 

I have added the SSH public key given to me by ReadyNAS to Digital Ocean SSH keys (copy-pasting in to the 'add new SSH key dialog in Digital Ocean Dashboard from the public key txt file that ReadyNAS generated)  and have given that key the name 'ReadyNAS' (just for originality)

Perhaps try running rsync manually from the NAS using ssh.  Log in as root on the NAS.  DigitalOcean does have a tutorial here: https://www.digitalocean.com/community/tutorials/how-to-copy-files-with-rsync-over-ssh but it runs in the other direction (assuming you are logged into the origin server, and you are logging into the destination server).

 

FWIW, it appears that you might not have an account with the username ReadyNAS set up on the DigitialOcean server.

 

Message 2 of 7
ArchPrime
Guide

Re: Rsync over SSH to Digital Ocean Droplet

Hi thanks - looks like you were on to something with missing 'ReadyNAS' account. 

 

I tried and apparently succeeded in adding an account by this name in Linux, but still no luck - but when I tried logging in as 'root' instead from ReadyNAS, the connection tested as ok.  However I was not able to browse for the source directory (browse button was greyed out)

 

Manually enetering the source path, then running a backup it looks like remote directory  and contents were found, but copying failed; giving 'Disk quota exceeded (122)' error.

 

The selected directory to sync contains only 90mb, and to my knowledge I have not set any quotas at source or destination.

 

Where is this error likely comming from?

 

One possibly relevent clue - when I use PuTTY to acess the Digital Ocean droplet server as root, I have to supply a pass phrase related to my root SSH key to log in .  Supplying of passphrases does not even seem to be an option from ReadyNAS.  Does this sound relevent?

Model: ReadyNAS-Ultra 6|ReadyNAS-Ultra 6
Message 3 of 7
StephenB
Guru

Re: Rsync over SSH to Digital Ocean Droplet


@ArchPrime wrote:

Hi thanks - looks like you were on to something with missing 'ReadyNAS' account. 

 

I tried and apparently succeeded in adding an account by this name in Linux, but still no luck - but when I tried logging in as 'root' instead from ReadyNAS, the connection tested as ok.  However I was not able to browse for the source directory (browse button was greyed out)

To be clear, I think this account is needed on the Digital Ocean server, not the NAS.  The key also needs to be connected to this account. (that is, placed into the account's ~/.ssh/authorized_keys).

 


@ArchPrime wrote:

One possibly relevent clue - when I use PuTTY to acess the Digital Ocean droplet server as root, I have to supply a pass phrase related to my root SSH key to log in .  Supplying of passphrases does not even seem to be an option from ReadyNAS.  Does this sound relevant?


Could be.  Have you checked the service status on the server when you are using root?

sudo service ssh status

 


@ArchPrime wrote:

 

Manually entering the source path, then running a backup it looks like remote directory  and contents were found, but copying failed; giving 'Disk quota exceeded (122)' error.

 

The selected directory to sync contains only 90mb, and to my knowledge I have not set any quotas at source or destination.

 

Where is this error likely coming from?

You were copying to the ReadyNAS?  If so, what was the destination path?

 

 

Message 4 of 7
ArchPrime
Guide

Re: Rsync over SSH to Digital Ocean Droplet

Thanks Stephen


 I set up 'ReadNAS' as a username on the Digital Ocean Server (I think) but may not have pulled this off correctly  - certianly did not manage to connect to the server from the ReadyNAS device using this user name.  (I should probably have picked a different name to avoid confusion!).  Not all of the instructions for adding a new user account that I found online worked as described

 

I  gave up on that and ended up adding the ReadyNAS device's ssh public key to the authorized_keys file on the Digital Ocean server for my root account - which at least now allows me to connect as as user 'root' from my ReadyNAS device,  Even if I can get no further.

 

Yes, I am trying to initiate a connection from ReadyNAS device, in order to retrieve the contents of a folder on the Digital Ocean server and save a copy of these to ReadyNAS shared folder 

 

*** EDIT ***

While I was typing this response, it seems the problem has somehow self corrected - I had set up backup interval to once per day, and it so happened that this backup just executed itself automatically, and succeeded!  I have no idea why it failed when initiated manually before.

 

I wonder if being simultaneously logged in as root from my PC via PuTTY helped in some way, or issuing that  check status command you suggested somehow  shook something loose?:

 

sudo service ssh status

 

Either way, much appreciate your help!

Message 5 of 7
StephenB
Guru

Re: Rsync over SSH to Digital Ocean Droplet


@ArchPrime wrote:

 

While I was typing this response, it seems the problem has somehow self corrected - I had set up backup interval to once per day, and it so happened that this backup just executed itself automatically, and succeeded!  I have no idea why it failed when initiated manually before.

 


That is mysterious (not sure how it would resolve a quota error), but if it is working, then all is well.  You should manually check the destination folder on the NAS, just to make sure everything is ok.

 

If you are doing incremental backups, you can combine this with custom snapshots on the destination share to give you some retention (ability to roll back to previous versions).  There is a setting there to only make snapshots when there are changes. 

 

Note there is also an option in the advanced settings that will delete files on the destination (readynas) when they are deleted in the source (digitalocean).  I use that option for my own backups (together with the custom snapshots).  Then the main share has the same contents as the source, with older files (deleted, renamed, etc) saved in the snapshots.

Message 6 of 7
ArchPrime
Guide

Re: Rsync over SSH to Digital Ocean Droplet

Tkanks Stephen - that makes sense.

 

For anyone else tryingto do the same thing,  below is the process that eventually worked for me:

 

 

  1. Enable SSH on ReadyNAS https://kb.netgear.com/30068/ReadyNAS-OS-6-SSH-access-support-and-configuration-guides

  2. Use PuTTy to access Digital Ocean server and type

nano /root/.ssh/authorized_keys

  1. in the editor, copy-paste in the public key used by ReadyNAS, appending this at the end of the /root/.ssh/authorized_keys file (be careful to not overwrite any keys already present).

  2. In the ReadyNAS backup dialog settings, I used::

Name: Backup via Rsync over remote SSH (drop down selection)
Host: mydomain.com (or server IP address)
Port: 22
path: /var/discourse/shared/standalone/backups/default (the path to files I want backed up on host - change to suit your own situation)
Login: root

 

(Noting that if you followed the instructions for setting up ReadyNAS for SSH access correctly, no SSH passphrase will be associated with its public/private SSH key pair. This is rather important, as the ReadyNAS backup dialog does not provide for a passphrase)

 

As noted, at first this process did not work fully for me - using the ‘Test’ button in the ReadyNAS backup dialog with these settings did result in successful connection, but then initiating a backup generated error ‘Disk quota exceeded (122)’
But then a couple of hours later, without further (obvious) intervention on my part, when the backup process initiated itself again on its auto designated hour, this time it just worked as it should.

 

Possibly my previous efforts at achieving a connection and testing using different settings were having some residual effect that impeded things at thetime, or perhaps being simultaneously logged in to the server from my PC as root via PuTTY at the same time as root via FileZilla (both using the original/default SSH public key associated with root) and then trying to log in as root via ReadyNAS device backup utility (using ReadyNAS’s public key that I added to authorized_keys file for root) was problematic.

 

 

Model: ReadyNAS-Ultra 6|ReadyNAS-Ultra 6
Message 7 of 7
Top Contributors
Discussion stats
  • 6 replies
  • 2140 views
  • 0 kudos
  • 2 in conversation
Announcements