The most restrictive access, in this case exclusive access to www/admin
with permission 0750
, is always the safest. Note that, in the permission mask above, users who are neither www
nor members of admin
are not allowed to access the contents of the directory at all; this is in order to reduce the possibility that an unauthorized party logged into the system gain access to potentially confidential information uploaded by users.
Do not forget that on most *nix platforms you also have a third, extremely flexible option, that is, setting ACLs using setfacl
. ACLs are a superset of what can be achieved with the regular permission bits and ownership methods. ACLs are the option of choice when confronted with complex security setups (including per-user permissions, default ownerships, etc. - but you may need to first add acl
to /etc/fstab
in the mount options of the volume hosting your directory, see man mount
.) You may choose to use ACLs if two or more users need access to the directory in question without being members of, say, the admin
group.