Subject: Rsync in chrooted ssh in alpine docker image result in failed to set permissions

From: François Lachèse <[email-masked]>
Date: Sat, 7 Nov 2020 17:46:13 +0100

Hello,

I use an alpine docker image with openssh and rsync installed.
If I try to rsync to the container, everything is working fine with
default ssh configuration.

As soon as I try to chroot the user and after copying bins and library
to the user directory I get errors.
for exemple :

rsync -a -e 'ssh -p 2222' /home/user/Pictures/ localhost:/backups/071120

gives

rsync: failed to set permissions on "/backups/071120/.Screenshot from
2019-12-26 13-47-24.png.NKoiaj": No such file or directory (2)

I tried the same configuration and rsync command with a ubuntu base
image and it works so I guess there is something different with the
Alpine image.

Any idea of what it could be ?

Thanks,
François

---

From: François Lachèse <[email-masked]>
Date: Tue, 10 Nov 2020 17:05:32 +0100

Thank you both for the help

Paul Bredbury wrote :
> Check the user and group numbers in /etc/passwd, which are different between e.g. Ubuntu and Alpine.

I used the same passwd file for both

Andrej Kacian wrote :

> Try adding -s to your rsync call. Perhaps there is a difference in how
> different remote shells (bash vs. ash) interact with rsync when it
> comes to file names with spaces in them.

I can't find -s in the rsync man... I replaced ash with bash as the user shell in my alpine image but the issue is still there.

---

From: Paul Bredbury <[email-masked]>
Date: Sat, 07 Nov 2020 16:59:31 +0000

---

From: Andrej Kacian <[email-masked]>
Date: Sat, 7 Nov 2020 18:01:11 +0100

On Sat, 7 Nov 2020 17:46:13 +0100
François Lachèse wrote:

> No such file or directory (2)

Regards,
-- 
Andrej