LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Permissions when creating files&folders (https://www.linuxquestions.org/questions/linux-newbie-8/permissions-when-creating-files-and-folders-873990/)

rbalaa 04-09-2011 10:09 AM

Permissions when creating files&folders
 
Hello,

I'm having a tough time with permissions. I want to make a folder and ALL its subfolders automatically have set permissions and ownerships on any file or folder created by any valid user.

example: 0770 root.staff test.txt

Please help. Thank you.

OS: CentOS 5

bigrigdriver 04-09-2011 03:08 PM

Look at file /etc/permissions. In it, you will see the default ownership and permissions for the system. Add an entry for the top level directory, with ownership and permissions you desire.

For example: let's say you have a data partition mounted at /mnt/data. You want root ownership, but staff group members should also be able to enter and write (create folders and files) in the data partition. Make an entry in /etc/permissions like this:
/mnt/data root:staff 777

Try it to see if it solves your problem.

rbalaa 04-09-2011 03:58 PM

I couldn't find a file "/etc/permissions", also I made a mistake in my post, this is actually Ubuntu (Debian). Does a 'permission' file exist on there.

Thanks for your reply and help.

theNbomr 04-09-2011 05:50 PM

I'm pretty sure you cannot cause the ownership of a file to be automatically set to some user other than the creator. Probably the same for group ownership. You can set the umask of each user to cause files to be created with a certain permission mask. You can make all of the users exist in the same default group, so that everyone gets the same group ownership and group permission.

--- rod.


All times are GMT -5. The time now is 10:57 AM.