imthenachoman / unraid-templates

NordLynx Docker template for unRAID
MIT License
3 stars 1 forks source link

Permissions incorrect when transferring from remote to local filesystem #8

Open shiruken opened 2 years ago

shiruken commented 2 years ago

I regularly use rclone to transfer remote files (via SFTP) to my Unraid server shares. However, despite specifying the UID/GID in the template, the permissions of files transferred from a remote to the local filesystem are root:root rather than nobody:users. This results in the transferred files being inaccessible to other users or applications attempting to access the files.

The rclone docker installation instructions note this issue:

By default, the rclone binary inside a Docker container runs with UID=0 (root). As a result, all files created in a run will have UID=0. If your config and data files reside on the host with a non-root UID:GID, you need to pass these on the container start command line.

It seems like the PUID and PGID are not having the intended effect.

imthenachoman commented 2 years ago

Are you doing this through the GUI from this Docker container?

shiruken commented 2 years ago

Yes, this is using the rclone GUI available through the docker container. My only modification during container installation is to add a host path mapped to /data on the container:

image

I set up two configs: one remote SSH connection and one local disk. Using the Explorer, I transfer a file from remote to local.

image

image

However, when I examine the ownership of the transferred file on Unraid, it is assigned root:root rather than nobody:users, with permissions that prevent other users or applications from modifying it.

image

Looking within the container, rlcone is running as root rather than the PUID and PGID specified in the template, which explains why the transferred file has the wrong ownership/permissions.

image