Rsync over SSH is generating an error that does not show up on on any sites

Joined
Mar 7, 2019
Messages
5
Prefacing with the fact that I'm a total newb, but trying to learn. Please be gentle!

I'm trying to Rsync over SSH, backing up data from my FreeNAS to a Synology NAS that I have been using for a few years now. I followed the instructions on this site since he's guiding step-by-step exactly what I'm trying to do.

This seemed to be working well, but when I got to the final step to actually set up the Rsync task, I'm getting this error right below the Remote Host line: Disconnect Error[ error code 14 ] was generated when trying to communicate with remote host 192.168.1.184 and remote user [redacted].

Searching through Google and on this forum directly, there are no results that come up for error code 14. What is happening and how can I resolve this? Alternatively, if there's a different/better way to backup the FreeNAS data to the Synology, I'm all ears!
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
Please provide more information on:

- Your network
- rsync command? Setting up from FreeNAS/Synology?
- Can youssh to both servers from a remote workstation with the same user?
- Can you ssh to one of the servers and rsync a small file with rsync -av --progress user@source_ip:/source_folder/file ./
 
Joined
Mar 7, 2019
Messages
5
Sure, here's what I know (like I said, new to this, sorry if anything is dumb)

- I simply have the FreeNAS and the Synology going into the little 8-port Netgear switch (which is also going to the router).

-Everything I did to get to this point can be found here: https://www.mattwall.co.uk/2016/04/03/rsync-to-synology-from-freenas.html I followed this but instead of making a new user to run the rsync task I am using root.

- I used putty to access both the Synology and FreeNAS from my desktop when I was following the instructions on that website, but what do you mean with the same user? Each system has a different username.

- This is where I'm kind of lost, these types of commands are not something I use regularly so I'm learning as I go. Since I don't really know what I'm doing but trying to learn, I tried a few different things:

I used putty on my desktop pc, logged into the FreeNAS, ssh'd into the Synology, located a small text file on the FreeNAS and got this result:
Code:
receiving incremental file list

sent 19 bytes  received 41 bytes  10.91 bytes/sec
total size is 9  speedup is 0.15


Next I logged into the Synology with putty, and located another small text file on the FreeNAS:
Code:
receiving incremental file list
test.txt
           9 100%    8.79kB/s    0:00:00 (total: 100%) (xfer#1, to-check=0/1)

sent 42 bytes  received 97 bytes  30.89 bytes/sec
total size is 9  speedup is 0.06
So it looks like that worked? Did it actually copy the file somewhere though?
I also did the opposite, logged into FreeNAS and tried to locate a file on the Synology, and I logged into the Synology, ssh'd into the FreeNAS, and tried to locate a file on the Synology, but each time I tried to do anything with the text file on the Synology, I got this result:
Code:
receiving incremental file list
ERROR: module is write only
rsync error: syntax or usage error (code 1) at main.c(782) [sender=3.0.9]
rsync: connection unexpectedly closed (110 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.3]

I doubled checked all permissions for the username@Synology and it should have full read/write access to everything. Does this give you any useful information (besides the fact that I have no idea what I'm doing!?)
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
-Everything I did to get to this point can be found here: https://www.mattwall.co.uk/2016/04/03/rsync-to-synology-from-freenas.html I followed this but instead of making a new user to run the rsync task I am using root.

The task you have ahead of you is not an easy one. rsync between two boxes is simple, but getting two servers, from two different manufacture taking together is not.

Let me start saying that the user root does not exist in Synology, unless you've create it.

The article you used to create your FreeNAS/Synology back-up creates a user with the same name on both, so start with that change.

The tests I've asked you to perform proves that (1) ssh is working, (2) rsync is working, so it is not a problem with any of those.

My assumption is that the error you are getting is related with authentication - root user on Synology, maybe.

Unless someone else here has done this before, I'd say you got into a grey area, as it involves FreeNAS and Synology, the latter not supported on this forum, and FreeNAS not supported on Synology side.

Also I'm not sure why you are backing-up FreeNAS to Synology. If you have followed the recommendations on our Resource, for your hardware and set a good raidz configuration, you should have a pretty safe NAS.

Follow Matt's post, creating the user, and in case it fails again, I'd contact him for guidance.
 
Joined
Mar 7, 2019
Messages
5
I followed the directions again step by step - same error.

I did some more research and found this website: https://www.linuxquestions.org/ques...error-cannot-do-ssh-and-transfer-file-651106/

I manually ran the rsync command and it worked. Is it possible that the rsync task is setting something up incorrectly?

Edit: To be more specific, I used putty, logged in to freenas as root, then rsync -av -e ssh /path/to/directory/on/freenas/ rsync@SynologyIP /path/to/destination/
 
Last edited:

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hi,

Your last bit of info is of importance : when you do it manually, it works.

So that means the error is probably in your environment variables. Something is not configured in your SSH client, but your environment variables compensate for it.

It can be a path (compensated by your PATH variable but missing in your background job)
It can also be related to SSH itself, like pointing to SSH's native config files under your .ssh directory

So first debug step would be :
configure your SSH for you to be able to log in your target with just "ssh targetname"
All the IDs, keys, etc. will have to be extracted from your ssh config files.

Once done, do a simple script that SSH to your target and do a simple action. You then run that script from CRON.

Once that script will run properly from CRON, retry your background rsync job and should it fails, look for the RSYNC part and fix it the way you fixed the SSH part.

Good luck troubleshooting,
 

Raul_SU

Cadet
Joined
Apr 17, 2020
Messages
2
I had this same issue and I fixed it in the user, I created the same user with same password on both, the FreeNas and my linux server ....anyway, when I noticed my rsync didn't worked either, I verified all the permissions (make sure your user has the following: write permissions, sudo and zsh on the shell).

Then, while on the shell, make sure you can access your remote server from the NAS with your user:
su - yourUser
ssh yourUser@yourServersIp
Note: It shouldn't prompt you for a password, if it does, than you haven't configured the ssh key properly or your user does not has all privileges (see above).

If your user is correctly created/configured and it keeps prompting for a password, then you can do the following:
su - yourUser
<!--type in your password-->​
ssh-keygen -t rsa​
<!--it will prompt you for a passphrase, just hit enter twice-->​
more .ssh/id_rsa.pub //this is the key that you need to copy to your user in the authentication key​
ssh-keyscan -t rsa yourOtherServer

Finally test your connection to that server
ssh yourUser@yourServersIp //logs you to the other server​
rsync -av --progress /yourDirectory /otherServer'sDirectory //note: only one can be external: yourUser@server'sIp:/otherDirectory
If everything works correctly here you should be free to create your rsync over ssh task. :)
 
Top