How do I give a user permission to save files to /var/www/html?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Thanks for the quick response. The user is a member of the apache group (using gnome/system settings/users & groups). Is there a command I can use in a terminal to verify this?
Distribution: At home: Arch, OpenBSD, Solaris. At work: CentOS, Debian, Ubuntu
Posts: 3,625
Rep:
Check that apache group has write access to /var/www/html to do so, type 'ls -ld /var/www/html', any tutorial on Unix permissions will tell you how to interpret the results (I think there's one in the answers section here, if not googling on Unix permissions will turn up plenty). Post here if you're confused. Also do id <username> or groups <username> to verify your user is a member of the apache group.
Please correct me if I'm wrong, I'm fairly new to linux and apache but this sounds like a very bad idea. Aren't you in effect giving write permissions on all those files to anonymous browsers of your website? What I would do instead, as was suggested earlier, is create a new group (ie: webmasters), add the user to it and then chgrp and chmod for that new group.
Otherwise you're giving write perm to apache group, of which the apache user is a member, as which the httpd service runs.
While this is a necropost (a response to a thread that died long ago), I agree. Keeping the "least privilege" mantra in mind one should know when to rely on DAC rights or group membership and when to use ACL.
While this is a necropost (a response to a thread that died long ago), I agree. Keeping the "least privilege" mantra in mind one should know when to rely on DAC rights or group membership and when to use ACL.
I normally don't resurrect old threads but I saw that people are still taking that bad advice years later
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.