LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   file/directory access permission question (https://www.linuxquestions.org/questions/linux-general-1/file-directory-access-permission-question-61109/)

correro 05-22-2003 12:21 AM

file/directory access permission question
 
is there any way to set up directory access modifiers so that all files created in that directory will be owned by one user, no matter who created it?

slightcrazed 05-22-2003 07:33 AM

I do not believe so (someone please correct me if I am wrong).. File ownership is determined by the 'creator' of the file, and I do not think it can be changed on a directory by directory basis. I supposed you could create a script to run as a cron job that would chown all the files in the directory periodically, but that is more of a workaround, and not a solution.

Anyone else have any thoughts?

slight

PhilD 05-22-2003 08:55 AM

Okay, I am just curious. Why would you want to do this? Your users would effectively be able to create a file that they have no access to?

I am not sure how this could be done, other than the cron job mentioned above. I am just wondering what someone would use this for.

PhilD

acid_kewpie 05-22-2003 09:09 AM

funny how obscure questions tend to crop up in bunches....

you can set the sticky bit on the directory (chmod 1777 dir) which will force any file created in that directory to be owned by the group. I don't believe it will set the actual user, but that's the point of groups really, so it should be sufficient

correro 05-22-2003 07:48 PM

your insights are enlightening, especially the one about sticky bit @_@

correro


All times are GMT -5. The time now is 01:24 AM.