Im getting confused about permissions and sftp access in ubuntu.
I have a user who has access to the www folder :
<username>:www-data
I have set the following in sshd_config:
Subsystem sftp internal-sftp
Match group www-data
X11Forwarding no
ChrootDirectory /var/www
AllowTcpForwarding no
ForceCommand internal-sftp
Match
Match user <username>
X11Forwarding no
ChrootDirectory /var/www/<theirwebsite>
AllowTcpForwarding no
ForceCommand internal-sftp
Match
I have changed in sshd_config the location of authorized_keys (due to ubuntu encrypting the home folder)
AuthorizedKeysFile /etc/ssh/%u/authorized_keys
I have chown -R username:www-data to all the www directories
And chmod them also to 755
Sometimes I can access through sftp, but then it wont let me edit files. Other times I cannot access at all.
I would really be grateful for any explanation or maybe to point to a help file somewhere.
Cheers