sftp users need to be able to maintain their account's websites via sftp. I have created a "sftponly" group for them.
Apache (user: www-data) needs to be able to read, write and execute in these users' "www" folders. For instance, Wordpress auto-update feature should work without specifying ftp credentials.
The file structure I follow is like this:
I managed to make either requirement work, but not the two alongside.
Here is the process I follow to create a new user at the moment:
adduser <username> usermod -G sftponly <username> chown root:root /home/<username> chmod 755 /home/<username> cd /home/<username> mkdir www chown -R <username>:sftponly * chown -R www-data:www-data /home/<username>/www chmod -R 770 /home/<username>/www
How can I meet both requirements?
System: Ubuntu 14.04, Apache 2.4.7