-   Linux - Newbie (
-   -   Default Permissions and Sharing with Ubuntu 10.04 (

splap 10-26-2010 12:02 PM

Default Permissions and Sharing with Ubuntu 10.04

I'm trying to make a directory ('/home/sales/') that every user in a specified group ('sales') can modify without restraint, but anyone outside of that group can only read.

I've set up the directory to have the permissions 775, but any files created are being created with permissions 755! I've tried setting umask to 002, and still no use.

Can anyone give me any help?

Expeto 10-26-2010 12:09 PM

I use a workaround for a similar problem.

crontab this for every minute,
chmod -R 775 /home/sales/

I would love to know if there is a more elegant way of doing this

splap 10-26-2010 01:57 PM

I thought of that too, but to be honest I'm really trying to avoid that

Thanks for the help though

splap 10-26-2010 04:16 PM

Is there really no one that can help me?

Can't I change a setting somewhere? Or write a new script somewhere? Something?

GazL 10-26-2010 05:42 PM

The umask 002 should be working (assuming you're not doing anything daft like trying to use permissions on a filesystem type like FAT that doesn't support them).

What do you see if you do a

cd /home/sales
umask 002
touch testfile
ls -l testfile


If that works as expected, then it must be down to how the files are being created.

By the way, if you haven't already then you probably want to do a
chown root:sales /home/sales
chmod g+s /home/sales

in order to enforce the setting of the correct group on all new files/directories created under that directory.

splap 10-26-2010 08:33 PM

(I'm on a different computer)

I think that umask is working. But it's not for my computer, and the user who owns it can't use the terminal, nor is it really an option to teach them. Is there a way to get it to do this automatically?

GazL 10-27-2010 04:12 PM

Not reliably no. With the exception of the set-group-id on directories, the UNIX permissions system doesn't do inheritance in the same way that the NTFS permission system does. The user or program creating the file is responsible for setting the permissions on it appropriately.

You might want to read up on POSIX ACLs (man 5 ACL), but IMO they're a pain to manage and more trouble than they're worth. The cron solution already suggested is probably your easiest option.

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