[SOLVED] [Adding users to apache group] Security risk ?
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm setting up a LAMP server. The user's home directories will contain the websites.
The users need to be able to create (sub)directories that are writable by apache.
Trying to change the group of such a directory to apache by the owner of the directory results in a permission denied as the owner is not a member of the group apache.
The find command does not reveal too many files that are related to apache (either owner or group) so is there a security risk by adding the user(s) to the apache group?
The default permissions are usually 755 (umask 022) so apache can only read. And if an user is not a member of a group (apache in this case), he can not change the group of a file to that group (see btmiller's reply in this thread.
I don't want to give a sysadmin a call each time I have to change the group of a file or directory. That's why I want to add the users to the apache group.
Last edited by Wim Sturkenboom; 11-07-2007 at 09:22 PM.
I would make the directory world-writable (or writable to apache via acls, if you know anything about that one) and setgid the user (eg: chmod g+s directory). Then no changing groups is required (the files will be created owned by apache and group inherited from the directory). No adding users to the apache group is required, things are a little more sane, and the forward-facing fix is done in userspace.
Adding the user to the apache group is fairly safe, too.
I don't know anything about acls, so that option is off the menu for now.
I don't consider making the directory world-writable an option as anybody can write the directory in that case (something I'm trying to prevent).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.