rsync over ssh setup help

Status
Not open for further replies.

Nystral

Cadet
Joined
Jul 30, 2017
Messages
2
I have a rsync process setup on a soon to be retired Linux box that syncs every n hours over SSH using a private key as the authentication mechanism.

In Linux the command is:
Code:
rsync -rltvvz -e "ssh -i key.pvt" Nystral@remotehost:/path/to/remote/share /path/to/local/share


Basically I'm pulling the files over, stripping the permissions, and telling rsync to be very verbose (in the event I run a manual pull vs the cron. Later revisions of the command run a speed test and add a file lock, but that's beyond the scope of this initial command

Since it was already pulling to a FreeNAS box, I'm hoping to move the rsync task to the box itself.

So my questions are:

1) can I set up this equivalent in the GUI?
2) If no, what gotchas should I be looking out as I implement as a cron job via the CLI?
 
Last edited:
D

dlavigne

Guest
Yes. To make sure it has all of the switches you want, create the task then take a look at /etc/crontab. If any switches are missing, you can add them to the "Extra options" field of the rsync task.
 

Nystral

Cadet
Joined
Jul 30, 2017
Messages
2
I'm running into the same problem many other users seem to have - namely I can;t seem to get the rsync over ssh to "save" on the GUI. I get the error message "
In order to use rsync over SSH you need a user
with a public key (DSA/ECDSA/RSA) set up in home dir."

I have working ssh keys from my linux install that I would like to continue to use if possible. I've put the private key in the rsync user's .ssh, I've added the public key to the user's entry in the users dialog and authorized_keys. I'm not sure what I'm missing here, I need the rsync over ssh as ssh is one of the few ports opened on the remote host firewall and the existing system just works. Not sure what I'm missing here.
 
D

dlavigne

Guest
Which build version of FreeNAS (from System -> Information)? Do you get an error when you paste the public key in the user's entry in the GUI? Do you get anything in /var/log/messages when the rsync task runs? Does that user have permission to copy the files in the rsync task?
 

James S

Explorer
Joined
Apr 14, 2014
Messages
91
I would like to set up rsync using the FreeNAS 11 u4 GUI. The job is to pull data from an Ubuntu 16.04 server to the FreeNAS server. I've spent quite some time with the user guide and various posts on here. However I'm missing something -- the guide seems to emphasize setting the job up as push -- and so there is no mention of private key locations on the NAS (which seem essential for a pull?). I'm also getting similar error as above i.e., "In order to use rsync over SSH you need a user . . . "

The two systems are:
- FreeNAS 11 u4 and Ubuntu 16.04
The setup and tests so far is:
- User "backup2" is setup on both systems
- I can SSH into the Ubuntu system as the user and write to the directory (i.e., /var/www/html)
- The private key of user backup2 is on the Ubuntu system
- The public key of user backup2 is on the FreeNAS (pasted in via the GUI as one line)
- I've attempted to add the public key of the FreeNAS to the knownhosts on the Ubuntu
- An rsync task is configured via the GUI - when I go to close the task setup window I get the error message about rsync needing a user. Clearly, I guess, this is not the underlying problem? (Since there is a public key pasted to the user selected in the GUI.)

I would be grateful if someone could specify the key locations and any tests to systematically to get this work.
Thanks!
 
Status
Not open for further replies.
Top