-   Linux - Server (
-   -   Group share directory permissions (

Neruocomp 07-08-2010 03:33 PM

Group share directory permissions
On our fileserver, we primary use samba to share files to our users, but a few users have to use ssh/sftp to access the file server. In samba we have the shares setup so that permissions are forced to be the correct group owner and group read/write. The problem is those few who access via ssh/sftp. There files do not have the correct permissions. These people are not the most computer savvy, I'm dealing with biologist here. Is there some way to fix this or will I just have to setup a cron job to go through and set permissions periodically?

archangel_617b 07-08-2010 07:33 PM

You can use the group sticky bit to stick the proper group and you can set the user's umask to default allow group writing. See "man chmod".

You can also use ACLs and set default ACLs, see "setfacl" and "getfacl".

I've always found that permissions can be a bit of a sticky wicket and once you get one sub-directory which has the wrong permissions, everything else underneath it remains broken so you may need to rely on a cron job. If you do have to do this, I would suggest using "find" and the -group and -perm switches to locate files and directories that done match what's required and then "-exec chgrp <whatever> {} \+" syntax. This will give you the fastest way of correcting files files with the wrong permissions (see "man find".

All times are GMT -5. The time now is 05:16 AM.