LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Permissions on a Share Server? (https://www.linuxquestions.org/questions/linux-server-73/permissions-on-a-share-server-601132/)

carlosinfl 11-20-2007 08:59 AM

Permissions on a Share Server?
 
I need help with permissions on a RHEL4 ES server. Right now I have a simple directory called "/share/security"

Code:

[root@fback security]# ls -la
total 1604
drwxrwx---  3 root      security    4096 Nov 20 09:21 .
drwxrwsr-x  7 root      root        4096 Nov  1 09:48 ..
-rwxrwx---+ 1 jon        jon        67072 Nov 20 09:20 newuser.txt
-rwxrwx---  1 jill      jill      66175 Nov 13 10:24 timesheet.txt
-rwxrwx---  1 jill      security  663861 Nov 15 08:39 pics.txt
-rwxrwx---+ 1 jon        jon        158720 Nov 20 09:21 data.txt
-rwxrwx---+ 1 jill      security  613888 Nov 16 14:17 info.txt

Now I only have two people I want to have access to this directory (/share/security) and I want two simple things. When a user creates a file in /share/security, the ownership is *:security and the permissions always remain 770 in the /share security folder.

Above * = the user creating or changing the file.

Is this hard to do?

wolfperkins 11-20-2007 09:44 AM

This is highly dependent on the user environment. umask controls what default permissions get assigned to a filesystem object. Also, by default, a file/folder you create gets the ownership assigned to you with your current group. To use a different group one must issue the newgrp command.

The easiest for you would be to have a cron job as root that automatically resets permissions on your folder and run it often.

carlosinfl 11-20-2007 10:11 AM

I would think we could add some kind of sticky bit to the group permission or something, no? This way it will never over ride the group ownership to something other than "security" and the 770 I would assume we could do some kind of umask...

scotlarsen 11-20-2007 12:52 PM

chmod g+s /path_to_directory

carlosinfl 11-20-2007 01:11 PM

Quote:

Originally Posted by scotlarsen (Post 2965560)
chmod g+s /path_to_directory

Yes - I actually tested this before you posted it and it works but thanks for letting me know!

Now I am only trying to see how to force 770 permissions on any file or directory under /share/whatever for any user that post in that directory.


All times are GMT -5. The time now is 03:50 AM.