RSYNC between OMV and Storagebox Hetzner

  • Hi,


    Below, are the steps to take, when you want to setup an RSYNC backup job between a local folder, and a Storagebox from Hetzner.

    Prerequisites

    • Create an SSH key on OMV over CLI
    • Copy the SSH keys (public/private over CLI)

    Create the keys

    SSH into your OMV

    Code
    ssh root@<your-omv-ip>

    Generate the SSH key

    Code
    ssh-keygen -t rsa -b 4096 -m PEM -f /root/.ssh/hetzner_storagebox_rsa -N ""

    Then, upload the key to Hetzner's Storage box user/sub-user

    Code
    cat /root/.ssh/hetzner_storagebox.pub | ssh -p 23 [username]@u[username].your-storagebox.de install-ssh-key

    Accept the host key (This is critical for OMV)

    Enter your storage box password, when prompted

    You will receive the following response

    Code
    Key No. 1 (ssh-rsa root@omv-storage) was installed in RFC4716 format
    Key No. 1 (ssh-rsa root@omv-storage) was installed in OpenSSH format

    Test connection

    Code
    ssh -p 23 -i /root/.ssh/hetzner_storagebox_rsa [username]@u[username].your-storagebox.de ls

    Next step, is to import the keys into OMV

    Go to System > Certificates > SSH

    Click + and then click import, however, before you do this, please following the steps below, over CLI


    Display both keys, and paste them inside the right locations in the GUI, start with the private key

    Code
    cat /root/.ssh/hetzner_storagebox_rsa 

    This will display the following

    Code
    -----BEGIN RSA PRIVATE KEY-----
    [your private key here]
    -----END RSA PRIVATE KEY-----

    Copy the full part, from the start to finish, and paste this inside the text field, for the private key


    Then, display the public key, and do the same

    Code
    cat /root/.ssh/hetzner_storagebox_rsa.pub

    This displays

    Code
    ssh-rsa [public key here] root@omv-storage

    Copy the full part, from start to finish, and paste this inside the text field, for the public key


    Add a tag, because you need this shortly, and click on Import

    Create your RSYNC job

    Go to Services > RSYNC > Tasks

    Click on Create

    • Type: Remote
    • Mode: Push
    • Source: Your folder
    • Destination server: USERNAME@USERNAME.your-storagebox.de:

      NOTE: Important, you need to add the : at the end, otherwise it won't work
    • Authentication: Public Key
    • SSH Port: 23
    • SSH Certificate: The certificate we created, with the tag you added.
    • Set the time/date you want to run it, and add a tag

    Click Apply


    Then, do a test run, you will see output:

    Code
    Please wait, syncing </srv/[diskname]/[foldername]/> to <[username]@[username].your-storagebox.de> ... 
    [file summary here]
    
    sent 68,508 bytes received 392 bytes 45,933.33 bytes/sec total size is 67,185 speedup is 0.98 The synchronisation has completed successfully.  END OF LINE


    Congratulations, you can now sync to your remote storage box

    Mike Johnson

    "I did it for me. I liked it. I was good at it. And I was really... I was alive"

    8)


    Running OMV on:

    • NETGEAR RR2304: omv 8.0.3-1 synchrony
    • NETGEAR RN528x: omv 8.0.3-1 synchrony
  • chente

    Approved the thread.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!