Backing up FreeNAS Storage

Status
Not open for further replies.
Joined
Apr 30, 2017
Messages
8
I have a need to backup the FreeNAS server I setup. I have a Synology NAS that I intend to use as a backup destination, however I am having trouble getting rsync to work. I am open to alternatives on how to back it up, or assistance with the rsync setup.

I tried walking through the guide I found here: https://www.mattwall.co.uk/2016/04/03/rsync-to-synology-from-freenas.html however it appears I must be missing something in the SSH Key Authentication section. I am unsure how to properly establish the password to authenticate rsync of ssh on both devices. it says in the guide:

"This output the newly created public key which I then copied and pasted it into the Public Key field for the rsync-backup user account in FreeNAS. I also pasted this key into the authorized_keys file I created earlier for the rsync user on the Synology NAS as the ssh-copy-id command does not appear to work in FreeNAS."

however I am not sure how to proceed through that and when I test ssh between NAS's it works but asks for a password every time and the RSYNC setup seems to fail with the error indicated in the guide.

Any suggestions on how to proceed?
 
Joined
Apr 30, 2017
Messages
8
Does anyone have any input or assistance they can lend in setting up an rsync from FreeNAS to a synology?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
however I am not sure how to proceed through that
^^ When you say this, sir, are you saying that you don't know how to paste the key into the authorized_keys file on the Synology? Because that we can probably help you with.
 
Joined
Apr 30, 2017
Messages
8
^^ When you say this, sir, are you saying that you don't know how to paste the key into the authorized_keys file on the Synology? Because that we can probably help you with.

That would be helpful. I don't see a means on the synology side of loading the password into the authorized_keys file, and when I generate the key on the FREENAS side it doesn't appear to be real text that can be copied and pasted.

rsync-backup@FreeNAS:~$ ssh-keygen # Do NOT set a password for this key
rsync-backup@FreeNAS:~$ cat .ssh/id_rsa.pub

doesn't appear to generate an editable file.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
I don't see a means on the synology side of loading the password into the authorized_keys file, and when I generate the key on the FREENAS side it doesn't appear to be real text that can be copied and pasted.

There are some misconceptions here. First off, we are not loading the password into the authorized_keys file. We are created an asymmetric public/private key pair, and using that for authentication. It's the public key that we are loading ito the authorized_keys file. Second, a key is going to look like a bunch of gibberish. It's plain text, but it's not really human readable in that sense. For an example, see here: https://www.digitalocean.com/commun...ying-your-public-ssh-key-to-a-server-manually

Looking through the guide, the key steps are in the section labeled "SSH Key Authentication"

First, did you create all the correct files/folders for the rsync users on the Synology? The important file for getting the key authentication to work is the authorized_keys file. This is created with the following command:
Code:
rsync@Synology:~$ touch /var/services/homes/rsync/.ssh/authorized_keys

(Again, assuming that you created the rsync user home directory).

Then, we need to copy the key we've generated on the FreeNAS to the rysnc. It looks like you did the above correctly. When you cat .ssh/id_rsa.pub, you should get a long string of text. You need to copy this entire line.

Now, you go back to your Synology. There are a couple different ways to paste the data into the file, but an easy one is:
Code:
echo "<really long line from before>" >> /var/services/homes/rsync/.ssh/authorized_keys

When you're done, you should be able to do cat /var/services/homes/rsync/.ssh/authorized_keys and see everything as it should be.
 
Last edited:
Status
Not open for further replies.
Top