On a Debian apache2 server I'm trying to give access on a subdirectory of a webstie tree (Website home dir : /home/website/public_html/, access wanted only for a specific user: /home/website/public_html/boutique/modules/sftpwkmodules
So main website user has access to all tree (userweb).
But I need access for user sfkmodules to the subdirectory inside the tree and it doesn't work.
I created user sfkmodules, and group sftpwkmodules.
I setup these lines in sshd_config file:
Match group sftpwkmodules ChrootDirectory /home/website/public_html/boutique/modules/wkmanagesuppliers ForceCommand internal-sftp AllowTCPForwarding no X11Forwarding no
But when I connect to sftp with this user, it isn't allowed. In the log it seems that there is a bad ownership on fatal: bad ownership or modes for chroot directory component "/home/website/public_html/".
But I can't change ownership of all the tree just to have this user access to the subdirectory. Is there a way to make it works?