1

I am trying to guess the dropbear equivalent to this regular rsync command (using ssh with a proxy)

rsync -avz --delete -e "ssh -o 'ProxyCommand ssh user@proxyhost exec nc %h %p 2>/dev/null'" /tmp/a-folder user@host:/tmp

According to my search, it is all about the -J option in dropbear ssh but I can't manage to get it work.

What is the good way to achieve this ?

Additional informations : Dropbear is used for the client. Proxyhost is a regular Debian machine. Host is a Synology NAS.

ToYonos
  • 21
  • 8
  • In order to find out which options `rysnc` to passes to `ssh`, I created a script named `ssh` which simply writes its own arguments to a logfile. Then I put the directory with the script at the start of my path and tested the `rsync` command. What i found was that `rsync` on my machine (running Ubuntu 14.04) does not pass any `-J` option to `ssh`. So I'd say some more detail is needed in your question. What is the exact `ssh` command line, which `rsync` uses on your system? What error message does `ssh` produce? – kasperd Jun 21 '15 at 14:11
  • There is no error message. On my client (here it's an Android phone), i am using Dropbear version of ssh and rsync. I am trying to reproduce the above command. But in dropbear ssh, there is no -o option. According to the documentation, it's like this : `-J Use program pipe rather than TCP connection` but I did not found the proper syntax yet – ToYonos Jun 22 '15 at 13:47

1 Answers1

1

You can use -J instead of -o ProxyCommand. But -J does not support the %h and %p notation like ProxyCommand. That means you will need to specify hostname and port again.

Make sure you specify the same hostname both times, otherwise it is going to fail - most likely when verifying the host key.

This command should work:

rsync -avz --delete -e "dbclient -J 'dbclient -B host:22 user@proxyhost'" /tmp/a-folder user@host:/tmp
kasperd
  • 29,894
  • 16
  • 72
  • 122
  • 1
    If this doesn't work, you debug it it by testing inside out. So first verify that `dbclient -B host:22 user@proxyhost` works, next verify that `dbclient -J 'dbclient -B host:22 user@proxyhost' user@host` works. – kasperd Jun 22 '15 at 14:11
  • It is not working : `ssh: Connection to user@host:22 exited: Remote closed the connection rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]` It is trying to get to the host directly, without connecting to proxy host. – ToYonos Jun 23 '15 at 09:31
  • 1
    @ToYonos Then you need to test the individual parts like described in the comment above. – kasperd Jun 23 '15 at 10:39
  • 1
    My bad, my server was down yesterday, as my NAS (electrical outage). I just tried again your solution and it is working fine. Thanks a lot. – ToYonos Jun 24 '15 at 09:43