Guest forand Posted February 14, 2003 Report Share Posted February 14, 2003 Okay this is just a dumb question that I really should already know the answer to but. . .what requirements are there for me to run chown or chgrp on a file as a NON-root user? I am trying to change the group of some of my web content to apache since apache won't display it otherwise(unless it is world read/writable). But I have to su root to get it to work. This solution doesn't exist for my other users. Thanks for any help! Quote Link to comment Share on other sites More sharing options...
Cannonfodder Posted February 14, 2003 Report Share Posted February 14, 2003 The only way I can think of is to be part of a group that permits changes to those files/folders you want to chown. Maybe you need to create a new group and add apache, yourself, root, or whatever you need to that group. Then chown the files to the group... Quote Link to comment Share on other sites More sharing options...
aru Posted February 14, 2003 Report Share Posted February 14, 2003 no need for a new group, just become you and your users part of the apache group, and grant group-write permissions to your /var/www/ tree. (Just a though, I don't know if that might have security issues). Quote Link to comment Share on other sites More sharing options...
Guest forand Posted February 14, 2003 Report Share Posted February 14, 2003 cannonfodder - I was thinking of doing something like that. Is there a way to make any new files created in a given folder have certain properties? e.g. group, r/w permissions, etc. aru - I think that might allow my users to do stupid things with other apache files. I think that perhaps the best solution would be to add apache to all of my web developers group thus apache could have the group privleges but the users wouldn't be able to mess with other's files nor with apache files. Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted February 17, 2003 Report Share Posted February 17, 2003 chgrp: You have to be a member of the group you want the file to become owned by. preset permissions: You can achieve this result in a directory, by chmod'ing this directory the way you want, then placing the s bit. Eg: In Dir/, let's say I want all files to be -rw-rw----. Then I'd issue this command: chmod 6770 Dir/ or chmod ug+rws,o-rwx Dir/ Then any file created in this directory would have the permissions 660. Unfortunately, the s bit of Dir/ is not transfered to new directories inside. So this trick only "one level-deep"... So you have to chmod any new directory with the s bit. Yves. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.