I would like to restrict access to only one directory (and his dub directory) for a specific user when he is connected with sftp.
I created the user in apache group:
useradd m3dian -g www-data
#Subsystem sftp /usr/lib/openssh/sftp-server Subsystem sftp internal-sftp Match User m3dian ChrootDirectory /home/www/htdocs/m3dian/html X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp
I restarted ssh...
But when I try to connect with fileZilla I have the following error:
Connection reset by peer.
And in ssh logs:
fatal: bad ownership or modes for chroot directory component /home/www
# ls /home -l drwxr-xr-x 6 www-data www-data 4096 mai 18 2016 www
/home/www is the Apache directory.
Is it possible to configure the rights to keep www-data as owner of /home/www (and the sub directories) and allow m3dian to Chroot to /home/www/htdocs/m3dian/html ?