Jump to content

chown problem


Guest forand
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...