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

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...