"Permission denied" when running rsync job

  • Hello Forum,


    I would like to maintain this command as rsync job in OMV web interface (4.1.12 (Arrakis):

    Code
    rsync --rsync-path=/storage/.kodi/addons/virtual.network-tools/bin/rsync -avb root@libreelec:/var/media/INTENSO/Fotos /sharedfolders/Backup/libreelec/


    When I execute this in OMV bash, I need to enter the password of root@libreelec and then all folders/files get pulled from Libreelec to my OMV system.


    These are my settings in rsync jobs:

    • Type: Remote
    • Mode: Pull
    • Source Server: root@libreelec:/var/media/INTENSO/Fotos
    • Destination shared folder: libreelec [on BK01, Backup/libreelec/]
    • Authentication: Password
    • Password: *****
    • all additional settings: unchanged
    • extra options: --rsync-path=/storage/.kodi/addons/virtual.network-tools/bin/rsync

    When I perform "run" I receive this error message:

    my user rights for folder /sharedfolders/Backup/libreelec (and subfolders):


    drwxrwxrwx 3 root root 19 Mai 9 09:37 libreelec


    My first Idea: I would like to check which rsync command is in fact composed (and executed) from my settings in the rsync job. Where can I find this?


    My second idea: is </srv/dev-disk-by-label-BK01/Backup/libreelec> the same as /sharedfolders/Backup/libreelec ?


    Any other ideas how to solve this?


    Many thanks for your kind support


    Newtren

  • My first Idea: I would like to check which rsync command is in fact composed (and executed) from my settings in the rsync job. Where can I find this?


    My second idea: is </srv/dev-disk-by-label-BK01/Backup/libreelec> the same as /sharedfolders/Backup/libreelec ?

    Hello forum,


    is this a reasonable approach to solve my issue?


    • How can I check the full rsync command which is composed by OMV?
    • Can someone confirm, that /srv/dev-disk-by-label-BK01/Backup/libreelec is the same as /sharedfolders/Backup/libreelec?
      Otherwise I need to search in a different direction
    • "Permission denied (publickey,password,keyboard-interactive)." - shall I try to setup a passwordless login with public key?


    Thanks for any hints


    Newtren

  • I suspected that there might be a cron/anacron job somewhere. I found it here:


    /etc/cron.d/openmediavault-rsync


    It contains

    Code
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    # m h dom mon dow user command
    13 8 * * * root /var/lib/openmediavault/cron.d/rsync-fcc54383-1496-4715-8ca7-d1e17016770a >/dev/null 2>&1


    So I checked


    /var/lib/openmediavault/cron.d/rsync-fcc54383-1496-4715-8ca7-d1e17016770a


    it contains


    So I executed this rsync command (line 30) in bash:

    the rsync command works (here with password (line 2)).


    My thesis:
    rsync may fail due to login issue on libreelec.


    So I configured passwordless login:


    (public key already exists already on OMV, so I just copied public key to remote device "libreelec"):


    and it works with ssh:


    Now the rsync command works in bash without PW:


    Final test: what if I execute the rsync job in OMV web gui (did not change the settings):


    :thumbsup:


    Conclusion:
    rsync works in my case only with public key authentication even the rsync job is set up with password authentication.

  • Glad you found a solution :) I too set up my rsync job using keys as opposed to passwords, which took a min to set up but works flawlessly.


    A side question if you don't mind, can you modify the content of the destination folder over SMB? Because on mine, as soon as a rsync job is run, the destination folder becomes sorta "read-only" when working with SMB... makes me wonder whether this is the correct behavior.


    Cheers.

  • thanks Newtren !

    Addition: create the Public Key in "Certificates" -> "SSH" -> "+ Add", type in a name to identify the key. Afterwards when you go to "copy" you can copy the public key to the server, no ssh-copy-id command needed

  • Hi there,

    I come into this conversation while searching for this "copy"


    @kevbu do you know what command is run by OMV when this "copy" is run ??

    I would like to create a cron job doing the exact same thing.... "copy" the certificate to a remote server...


    any advice ?

  • ...

    I am asking cause trying to run the command

    Code
    ssh-copy-id -i ~/.ssh/id_rsa user@host

    the key added to the remote host is much different than the key added using the OMV's "copy" command

Participate now!

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