The eternal 'how to allow user to edit www-data files' problem.

Smoot Carl-Mitchell smoot at tic.com
Tue Apr 12 14:00:55 UTC 2022


On Tue, 2022-04-12 at 14:43 +0100, Chris Green wrote:
> I have bumped up against this problem for many, many years and have
> never found a really satisfactory solution.
> 
> I want user 'chris' to be able (easily) to edit files owned by user
> www-data without affecting their use by apache2.

Check out the use the setgid bit on a directory. Files created in such
a directory will be owned by the group of the directory and not the
primary group of the user. You will also need to make the directory
writable by the group. The newly created files will be owned by chris,
but will have the group www-data in your example. The user chris will
also need to be in the www-data group. The www-data user should still
be able to read the files in the directory since it is a member of the
www-data group.
-- 
Smoot Carl-Mitchell
System/Network Architect
voice: +1 480 922-7313
cell: +1 602 421-9005
smoot at tic.com





More information about the ubuntu-users mailing list