Set File Access Control List

Sets Access Control Lists (ACLs) – adds permissions to files and directories for a user that is not a member of a group owning them.

Gives a read permission to user for target directory and sub directories and files, although the target directory is owned by another user

setfacl -R -m u:user.name:r /target.dir

By adding wx parameters, user gets both write and execute permission

setfacl -R -m u:user.name:rwx /target.dir

Example for single file

setfacl -R -m u:user.name:rwx filename

Read ACLs

getfacl /target.dir or filename

Prerequisite for using ACL is that the file system is mounted with “acl”. This can be checked using:

tune2fs -l /dev/disk.partition

The output should contain a line: Default mount options: user_xattr acl, meaning that partition is mounted using acl and is suitable for setfacl.

Example that solves my problem with files downloaded by qBittorrent:

setfacl -R -m "u:user.name:rwx" /path.to.qbittorrent.download

When qBitttorent downloads a file, the owner and the group of that file is set by qBittorent, so it is easiest for me to just FACL target directory.