LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   RSYNC over SSH using OpenWRT and Seagate Personal Cloud (https://www.linuxquestions.org/questions/linux-networking-3/rsync-over-ssh-using-openwrt-and-seagate-personal-cloud-4175600495/)

mackowiakp 02-24-2017 02:23 AM

RSYNC over SSH using OpenWRT and Seagate Personal Cloud
 
I have possibility to use 2,5 GB Internet link in geographically distant location for backup needs. So I want to use TP-Link Gigabit router WR-1043WD with OpenWRT installed on it. There is Seagate Personal Cloud 3,5'' 4TB connected to router over Ethernet cable. Seagate Personal Cloud has possibility to run RSYNC client and server, but there is no SSH on it. I dont want to install alternative software on Seagate Personal Cloud because of warranty. But of course it is very simple to run SSH and RSYNC on OpenWRT. My idea is to RSYNC over SSH data from home server to the distant location mentioned before. My question is. How can I tunnel RSYNC traffic over SSH to router and than RSYNC without SSH data with Seagate Personal Cloud in clear (unencrypted) form?

pan64 02-24-2017 02:53 AM

that looks like a simple port forwarding. You need to run rsync server on your Seagate Personal Cloud and you need to specify a server port (default is 873). But I still do not understand how do you want to reach what, from where and over ssh/rsync or ??

mackowiakp 02-24-2017 03:16 AM

I want to create ssh tunnel between my home server and OpenWRT router and than RSYNC data from server to Seagate Personal Cloud unit connected to router. Of course I can use OpenVPN instead but I think that SSH tunel is more easy to use and maintain.

Turbocapitalist 02-24-2017 03:19 AM

Is there any way to get SSH on the "Seagate Personal Cloud" device? Then it would be a matter of simple port forwarding from the TP-Link

mackowiakp 02-24-2017 03:28 AM

This is exactly my problem. There is no way to run SSH on Seagate. As I wrote, it is possible to install alternative firmware on Seagate (with SSH - dropbear installed) but I will lost 3 years warranty.

pan64 02-24-2017 03:29 AM

if there was no ssh server on your Seagate Personal Cloud device you cannot ssh tunnel onto it. But you can forward a port from your router to that device and you can rsync using your router's ip/port.

Turbocapitalist 02-24-2017 03:43 AM

Yes, if you can SSH to or via the router, I'm pretty sure you can have SSH do the forwarding so that at least the external connection is encrypted. You'll have to know which port rsync on the "Seagate Personal Cloud" uses to listen.

Code:

ssh -L 8873:seagate:873 router.example.org
Then you should be able to rsync to localhost and it will be forwarded via the router to the Seagate.

Just a guess.

mackowiakp 02-24-2017 03:43 AM

Yes I can forward port but transmission over Internet will not be encrypted

mackowiakp 02-24-2017 03:48 AM

Quote:

Originally Posted by Turbocapitalist (Post 5675354)
Yes, if you can SSH to or via the router, I'm pretty sure you can have SSH do the forwarding so that at least the external connection is encrypted. You'll have to know which port rsync on the "Seagate Personal Cloud" uses to listen.

Code:

ssh -L 8873:seagate:873 router.example.org
Then you should be able to rsync to localhost and it will be forwarded via the router to the Seagate.

Just a guess.

Yep. It should work. I will try.

pan64 02-24-2017 06:00 AM

and again, if there was no ssh (server/client) on seagate you cannot make encrypted connection. Tunnelling might work.

mackowiakp 02-25-2017 04:05 AM

Problem totally resolved. New version of Seagate firmware, allows RSYNC over SSH natively !!! Good boys....

jdeck 03-16-2017 12:35 PM

Hi mackowiakp,

What rsync command are you using with your Seagate?

I have a Seagate Personal Cloud 2 Bay running firmware version 4.2.13.0 and no matter what I try, I get this error:

Code:

# /usr/bin/rsync -v netbackup@192.168.2.43:./
netbackup@192.168.2.43's password:
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.0]

Thanks!

mackowiakp 03-16-2017 12:59 PM

RSYNC implementation in Seagate is very primitive. It has only one rsync instance. So correct syntax should be:

Code:

/usr/bin/rsync -v /source_dir netbackup@192.168.2.43::NetBackup
And You will have /source_dir copied to NetBackup dir on Seagate GUI

jdeck 03-16-2017 01:09 PM

Quote:

Originally Posted by mackowiakp (Post 5684290)
Code:

/usr/bin/rsync -v /source_dir netbackup@192.168.2.43::NetBackup

Thanks so much. Darned double colon!!!


All times are GMT -5. The time now is 05:20 AM.