What's new

Setting up Rsync with OpenVPN for remote backup

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

huotg01

Senior Member
This follows thread http://forums.smallnetbuilder.com/showthread.php?t=19704

I have a local site (LS) and a remote site (RS). On LS, there is a RT-AC68u with a USB disk, and on the RS, I have a RT-AC56u also with a USB disk.

Before going further, let's say that:
-I can transfer a file from the LS to another local device (192.168.1.71)

Code:
Admin@1080-Router:/tmp/home/root# rsync -avz /tmp/syslog.log huogas@192.168.1.71:/tmp
huogas@192.168.1.71's password:
sending incremental file list
syslog.log

sent 9845 bytes  received 31 bytes  1519.38 bytes/sec
total size is 44821  speedup is 4.54

-I can transfer a file from LS to RS with no VPN:
Code:
Admin@1080-Router:/tmp/home/root# rsync -avz /tmp/syslog.log admin@[I]xxxxx[/I].asuscomm.com:/tmp
admin@[I]xxxxx[/I].asuscomm.com's password:
sending incremental file list
syslog.log

sent 8347 bytes  received 343 bytes  469.73 bytes/sec
total size is 44821  speedup is 5.16

Then I tried to setup the openVPN (please see the attached screen shots).
Everything seems ok but when I try to Rsync through the openVPN, I have this result:

Code:
Admin@1080-Router:/tmp/home/root# rsync -avz /tmp/syslog.log admin@192.168.2.6:/tmp

ssh: Exited: Error connecting: Connection timed out
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]

Does someone can help me to have a better understanding of what is goin on ?

Thanks,

GH
 

Attachments

  • OpenVpnRsync-4.png
    OpenVpnRsync-4.png
    67 KB · Views: 690
  • OpenVpnRsync-3.jpg
    OpenVpnRsync-3.jpg
    59.6 KB · Views: 338
  • OpenVpnRsync-2.png
    OpenVpnRsync-2.png
    56.4 KB · Views: 329
  • OpenVpnRsync-1.jpg
    OpenVpnRsync-1.jpg
    57.4 KB · Views: 536
Last edited:
I just turn off the VPN and came back to ssh tunnel with a private and a public keys.

I now know that the ssh "engine" on the Asus router is "dropbear". Dropbear can be used to generate the keys (no ssh-keygen), but seems to have no debugging option when the result is not was expected.

In my case I want router 1 to ssh connect to router 2 without password.
The keys were generated with dropbear on router 1.
The public key was copied to .ssh folder of Root on the other router, and added to the /home/root/.ssh authorized_keys ...but without any success.

How can I "debug" the problem ?

Thnks
GH
 
Rsync version 3.1.1 protocol version 31

I had problems using rsync from Optware, so I compiled rsync version v3.1.1 into Merlin's code. It fixed my problems. I can't recall what version Optware was at the time. It would be nice if the latest version was in Merlin's firmware :eek:

rsync version 3.1.1 protocol version 31
Copyright (C) 1996-2014 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
no socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, no ACLs, xattrs, no iconv, symtimes, prealloc
 
Last edited:
ssh without password

I had problems using rsync from Optware, so I compiled rsync version v3.1.1 into Merlin's code. It fixed my problems. I can't recall what version Optware was at the time. It would be nice if the latest version was in Merlin's firmware :eek:
;-) Thanks nairn62
In fact I have (so far...) no problem with Rsync. Seems to work perfectly well. The one provided with Optware is ok with me (by the way, what was the problem ?).

My problem is with ssh, public key, private key...

In order to downsize my initial problem, first I just want to ssh login on Router 2 (remote) from Router 1 (local). In fact: ssh admin@[I]router2[/I].asuscomm.com
When I do it, I have to enter the remote password and it works.

When I will succeed to ssh login (without entering a password) from R1 to R2, then I will be in business to Rsync in a Cron job.

To do it without entering a password, I have to generate a private and a public rsa keys. On the Asus router, the tool do do that is Dropbearkey (and not ssh-keygen).

So I did it on both ends (R1 and R2), each of them keeping their private key in their respective /home/root/.ssh folder.

The public key of one router is then placed using the router GUI in Administration/System/SSH Authentication key field of the other router.

As long as I know, everything should work, but it doesn't. My problem ? I don't know how to track it down. Dropbear doesn't seem to talk much (no trace, no log file).

Someone can help me with that ?
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top