Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
08-16-2004, 09:12 PM
|
#1
|
LQ Newbie
Registered: Jul 2004
Location: Neebraskee
Distribution: FC2, Suse91, Mandrake10
Posts: 21
Rep:
|
How do I give a user permission to save files to /var/www/html?
I believe that I need to do a chmod on the var/www/html directory, or just the files in it - but I'm not sure.
TIA!!!
FedoraCore2, Apache 2.0
|
|
|
08-16-2004, 09:17 PM
|
#2
|
LQ Newbie
Registered: Jun 2004
Distribution: redhat/fedora
Posts: 24
Rep:
|
you could put the user in the apache group or create a seperate group with r/w access to that dir and put the user in it
|
|
|
08-16-2004, 09:26 PM
|
#3
|
Member
Registered: Dec 2003
Distribution: Slackware
Posts: 32
Rep:
|
chown -R {usersname} {path to file/dir}
|
|
|
08-16-2004, 10:02 PM
|
#4
|
LQ Newbie
Registered: Jul 2004
Location: Neebraskee
Distribution: FC2, Suse91, Mandrake10
Posts: 21
Original Poster
Rep:
|
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?
|
|
|
08-16-2004, 10:05 PM
|
#5
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
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.
|
|
|
08-17-2004, 08:42 AM
|
#6
|
LQ Newbie
Registered: Jul 2004
Location: Neebraskee
Distribution: FC2, Suse91, Mandrake10
Posts: 21
Original Poster
Rep:
|
Thanks for the help - it appears root is the owner, as ls -ld produces:
drwxr-xr-x 2 root root 4096 Aug 16 06:16 /var/www/html
So I guess I need to use CHOWN to change group ownership to apache instead of root as my user is a member of the apache group?
I am a little confused on the syntax of CHOWN to do that - I appreciate everyone's help!
|
|
|
08-17-2004, 09:43 AM
|
#7
|
LQ Newbie
Registered: Jul 2004
Location: Neebraskee
Distribution: FC2, Suse91, Mandrake10
Posts: 21
Original Poster
Rep:
|
OK, I got it !!
Opened a terminal, logged in as su, then did:
chgrp apache /var/www/html
Then:
chmod 775 /var/www/html
THANKS FOR EVERYONE'S HELP!!!
|
|
|
04-18-2007, 12:33 AM
|
#8
|
LQ Newbie
Registered: Apr 2007
Posts: 6
Rep:
|
Quote:
Originally Posted by rotnay6000
OK, I got it !!
Opened a terminal, logged in as su, then did:
chgrp apache /var/www/html
Then:
chmod 775 /var/www/html
THANKS FOR EVERYONE'S HELP!!!
|
Ran into the same question and this thread solved my problem. Thanks!
|
|
|
07-14-2009, 08:23 PM
|
#9
|
LQ Newbie
Registered: Jul 2009
Posts: 2
Rep:
|
Quote:
Originally Posted by rotnay6000
OK, I got it !!
Opened a terminal, logged in as su, then did:
chgrp apache /var/www/html
Then:
chmod 775 /var/www/html
THANKS FOR EVERYONE'S HELP!!!
|
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.
I could be wrong, so double check me...
|
|
|
07-14-2009, 08:40 PM
|
#10
|
Moderator
Registered: May 2001
Posts: 29,415
|
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.
|
|
|
07-14-2009, 08:45 PM
|
#11
|
LQ Newbie
Registered: Jul 2009
Posts: 2
Rep:
|
Quote:
Originally Posted by unSpawn
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
|
|
|
All times are GMT -5. The time now is 06:08 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|