I am getting following error in
auth.log when trying to connect to site using SFTP.
fatal: bad ownership or modes for chroot directory "/var/www"
ls -ld of this directory shows this:
drwxrwxr-x 4 root sftponly 4096 Aug 12 04:05 /var/www/
As you can see I have given full permission to group
sftponly. The user through which I am connecting to SFTP is
mysftpuser which is part of
If I do following then I can connect but cannot rename, edit, delete, overwrite any file or folder inside
sudo chmod 755 /var/www/
Match group sftponly
So in short
sudo chmod 755 /var/www/ allows me to connect but only in READ only mode.
sudo chmod 775 /var/www/ doesn't even allow me to connect.
How to fix this issue?