rsync client over ssh. How to save key?

Status
Not open for further replies.
Joined
Jul 7, 2014
Messages
2
I'm looking to configure an rsync task on a 9.2.1.6 FreeNAS host to have it pull from a remote Linux server via ssh, using key-based authentication. Because FreeNAS root user's home directory, /root, is in a read-only file system, I'm unable to save the ssh key for the remote server in the /root/.ssh directory.

What would be an elegant and safe approach to solving this issue?

The one thing I am not allowed to do is to flip the client-server relationship between FreeNAS and the Linux boxes. I can ssh to the Linux box, but I can't ssh to FreeNAS from the Linux box. I also can't do password authentication on the Linux box. It has to be key-based.

Thank you for your help.
 

c32767a

Patron
Joined
Dec 13, 2012
Messages
371
Either use command line options to SSH to tell it to get it's config/key from a writable location, or make root's home directory writable long enough to store the key.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Did you check out the FreeNAS documentation for ssh keys? Not sure what I'm missing but FreeNAS' manual include steps for setting up 2 FreeNAS boxes in a push->pull relationship so clearly FreeNAS documentation covers doing ssh keys for FreeNAS as a pull machine...
 
Joined
Jul 7, 2014
Messages
2
Sorry, I jumped the gun and posted the question here before reading the manual. I appreciate your help.
Yes, the manual says to open up the root file system for read-write and copy the necessary keys.

One thing I noticed was that the rsync command formed by FreeNAS based on the GUI input ignores the /root/.ssh/config for the remote username. It seems to always assume that the remote username is the same as the local username. So I ended up creating a FreeNAS cron task instead of rsync task and formed my own command.

Perhaps this is a minor bug in FreeNAS, but I am new around here. I don't feel confident about filing a bug report if indeed it is not a bug.
 
D

dlavigne

Guest
One thing I noticed was that the rsync command formed by FreeNAS based on the GUI input ignores the /root/.ssh/config for the remote username. It seems to always assume that the remote username is the same as the local username. So I ended up creating a FreeNAS cron task instead of rsync task and formed my own command.

That's interesting. Can you post both the FreeNAS command and your command?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Honestly, I find it better to file a bug and be told it's not a bug than to leave the bugs undocumented. I do believe that the usernames must match though because of how the actual communications work. So put that ticket in. ;)
 
Status
Not open for further replies.
Top