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

Chris Green cl at isbd.net
Tue Apr 12 15:11:06 UTC 2022


On Tue, Apr 12, 2022 at 07:00:55AM -0700, Smoot Carl-Mitchell via ubuntu-users wrote:
> 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.

But with the default 022 umask everywhere group members won't be able
to write all files will they?

-- 
Chris Green




More information about the ubuntu-users mailing list