tags:

views:

218

answers:

3

I want to share a folder among all users of a group : dev. So that all files are regardless of the owner can be edited by anyone in the group.

I have created the shared folder and set the respective permissions to the folder.

When a user creates a new file in that folder it belongs to owner:dev But the permission for the files are rw-r--r-- So other users who belong the same group are not able to edit the files.

Like default group become "dev" how can I set the default permission for the files created in that directory.

I don't want to use "umask" technique because the user will upload files into that directory throuh ftp and other tools.

A: 

I don't want to use "umask" technique because the user will upload files into that directory throuh ftp and other tools.

That's the only way to do it, unless those "other tools" are themselves able to adjust permissions.

Joonas Pulakka
Is Linux that much inflexible? This is a basic requirement.
Prabu
What's wrong with using umask? It's the simple way to fulfill this basic requirement. It's not Linux's fault if you "don't want" to use it.
Joonas Pulakka
A: 

If you have root access, you can set the default umask for everyone to 002 from /etc/bashrc (assuming bash the default shell for the users in question).

A hack (and this is less preferable to umask) is to setup a cron job that will run every minute and do a chmod -R g+w <dir>.

kingsindian
+2  A: 

This really belongs on serverfault and I already mentioned there's almost an exact duplicate there, but anyway there's a nice little solution you can use, which is the FUSE bindfs module (there's a package in ubuntu). You use it to mount one directory onto another mountpoint and can set things such as the default permissions of any files created here, their owner, group and the permissions of files already in the directory (which is what you seem to want).

wds