FreeNAS as a remote backup location

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
I want to use a CentOS box to host a handful of websites.I want to use my FreeNAS as an external backup location. The webserver will do daily backups to a local directory. I want to pull those backups into the FreeNAS every day wiht RSYNC for daily/weekly backups.


I am a bit confused as to how to set up the SSH keys. Should I make the key pair on the webserver, then export the webserver's public key to the FreeNAS box? Or do I do it the other way around?

Should I make a backup user or just make the keys as root?
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
it's insecure to allow root login with ssh, particularly to the general internet, even with ssh keys (especially an ssh key with no keyphrase), and usually inadvisable.
its recommended to have a separate user and give it ONLY replication access and nothing else. you have to add the user to the pool as having replication permissions.
if logging into the centos FROM freenas (pull), then private key on freenas and public key on centos.
if logging into the freenas FROM centos (push), then private key on centos and public key on freenas.
if you use a separate user remember to run the ssh-keygen while logged into the user

additionally, i think centos has zfs support; if you were to put your backups onto a zfs filesystem/dataset you could use zfs replication instead of rsync.
 
Top