Is it possible to have multiple SSH users who can't read/write each others files but still allowing Lighttpd to serve their files?
Each user would have different domains.
Make each user's files readable by their usergroup, and then add lighttpd to each user's usergroup.
If we have bob
and charlie
, and lighttpd is running as www-data
:
# Bob and Charlie own their public_html folders
# And cannot see each others' files
chown bob:bob /home/bob/public_html
chmod 770 /home/bob/public_html
chown charlie:charlie /home/charlie/public_html
chmod 770 /home/charlie/public_html
# But the webserver can see both their files
adduser www-data bob
adduser www-data charlie
This will add the www-data
user to the primary groups for bob
and charlie
, and allow the webserver to read any files marked under their group with group access. (Assuming that your webserver is running as www-data
. This might vary from system to system)
php-fpm
), then that usually runs under another user, which also needs to be granted access to each user's files.
May 28, 2013 at 19:27