Täglich Shaarli

Alle Links eines Tag auf einer Seite.

February 2, 2018

linux - What's the best way of handling permissions for Apache 2's user www-data in /var/www? - Server Fault
thumbnail

I think you may find POSIX ACL (access control lists) to be helpful. They allow a finer-grained permission model compared to the user:group:other model. I have found them to be easier to keep straight in my head since I can be more explicit and can also set the "default" behavior for a branch of the file system.

For example, you can specify each user's permissions explicitly:

setfacl -Rm d:u:userA:rwX,u:userA:rwX /var/www
setfacl -Rm d:u:userB:rwX,u:userB:rwX /var/www

Or you can do it based on some shared group:

setfacl -Rm d:g:groupA:rwX,u:groupA:rwX /var/www

And perhaps you want to keep your Apache user as read-only

setfacl -Rm d:u:www-data:rX,u:www-data:rX /var/www

Man pages:

setfacl
getfacl

Tutorial

Ausstellungseröffnung: Spielraum. Kunst, die sich verändern lässt

Die Ausstellung mit Leihgaben aus verschiedenen europäischen Ländern entstand in Kooperation mit der Landesgalerie Linz.

  1. Februar bis 22. April 2018