OMV Borg Plugin - how to configure the SSH between OMV and Vorta (Borg) server

  • Hi all


    I have a question about ssh authentication between OpenMediaVault and Vorta (Borg) backup.


    I am trying to set up a storage/backup solution on RPI5.


    Storage:

    I have a OMV running on a RPI5 (4GB) with 2 x 4TB M.2 SSD running as a Btrfs raid1 partitioin presenting 3.64TiB.


    Backup:

    I have installed Vorta backup on a RPI5 (4GB) with 2 x 4TB set up as 2 x 3.64TiB lvm partitions.

    I have created 2 x Borg backup repositories via the Vorta gui, one on each of the lvm partitions.


    The plan is to run a backup job on the OMV using the Borg plugin with the backup output to be saved to one of the backup repositories on the vorta server.


    I am using the following guide to set this up ‘https://forum.openmediavault.org/index.php?thread/36602-how-to-make-backups-with-borg-using-borgbackup-plugin/'.


    The bit I am having trouble with is how to set up the ssh public and private key authentication between the omv Borg plugin and the Vorta server.


    Can somebody please breakdown the steps that need to carried out to make this work, the above article states that it doesn’t explain this and expects you to have this in place but I am unsure how to set this up.


    Many thanks In advance :)

  • votdev

    Approved the thread.
    • Official Post

    vorta isn't a normal ssh server. You will probably need some guide from the vorta site.

    omv 7.7.7-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.5.1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Hi ryecoaaron, thanks for your reply. Borg is installed on my backup server (Vorta is only the frontend gui). guess my question is how do I set up the SSH keys/connectitiy between OMV Borg plugin and Borg server, thanks again for your support :)

    • Official Post

    guess my question is how do I set up the SSH keys/connectitiy between OMV Borg plugin and Borg server, thanks again for your support

    I guess I am still confused by your setup but the plugin runs borg commands as root. If you login to your OMV system as root, it should already have a public and private ssh key (look in /root/.ssh for for files starting with id_). If those exist, then you want to copy the public key to the destination system with ssh-copy-id dest_host_name. There is nothing OMV specific about this.

    omv 7.7.7-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.5.1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • A simple search like this, explains everything:


    ssh public key authentication at DuckDuckGo


    And a good guide:

    SSH Public Key Authentication: How to Configure

  • Firstly I'd like to thank Soma for the SSH article above, my linux is quite rusty and the article helped to jog the memory :) and also to Ryecoaaron for the support given :)


    A quick run down of what i am trying to do:

    I have an RPI5 running OMV7 and i have an RPI5 running Borg backup. the end state is to have the OMV server back itself up to the Borg server using the OMV Borg plug-in.


    What I've done so far:

    - I have set up the SSH encryption between the 2 servers and can SSH from one to another and vice versa without any issues (Thanks Soma).

    - I have successfully tested setting up a remote repository from the OMV server to the Borg server via the CLI, using the following command:

    gkenny@rpi-omv01:~ $ borg init gkenny@192.168.0.28:/mnt/nvme0n1/music/ -e repokey


    - I have tried to set up a repo in the Borg plugin without any joy and have assumed that the syntax i am using within the borg plugin is wrong.

    - As part of the setup of the borg plugin i have ran the following on the OMV server CLI:

    gkenny@rpi-omv01:~ $ export BORG_RSH='ssh -i ~/.ssh/authorized_keys' (not sure if this is correct)


    - If i run ls -l ~/.ssh/ i get the following:

    gkenny@rpi-omv01:~ $ ls -l ~/.ssh/

    total 20

    -rw------- 1 gkenny users 3025 Jan 28 00:12 authorized_keys

    -rw------- 1 gkenny users 2602 Jan 27 23:55 id_rsa

    -rw-r--r-- 1 gkenny users 570 Jan 27 23:55 id_rsa.pub

    -rw------- 1 gkenny users 2934 Jan 28 00:13 known_hosts

    -rw------- 1 gkenny users 2098 Jan 28 00:12 known_hosts.old


    What i would like help with:


    Question 1 - Is my version of the example below correct (export BORG_RSH='ssh -i ~/.ssh/authorized_keys')?

    export BORG_RSH='ssh -i /path/to/my_secure_server_key'


    Question 2 - Is the syntax below correct?

    This is the Env Var i have added -

    Question 3 - Is there anything else i am missing?


    Thanks in advance for any help regarding this as it is slowing down my home NAS deployment, lol :)

    • Official Post

    You are running commands as yourself. The plugin runs them as root. The ~ means the user's home directory that is running the command. So, you either need to move the key to root (recommended) or change the path in your environment variable to be the the full path of the ssh key.


    authorized_keys is not a key either. It is list of public keys allow to access the account. You need to use the private key - id_rsa in your pic.

    omv 7.7.7-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.5.1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Amazing, thanks Ryecoaaron I’ll have a play and come back to you if I need any more guidance/help if ok, thanks again :)

    • Official Post

    good to hear

    omv 7.7.7-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.5.1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Participate now!

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