You are not logged in.
Pages: 1
How can I share a directory among users in same group?
I tryed:
groupadd shared
useradd -d /sharedData -g shared admin
useradd -g shared usr1
useradd -g shared usr2
chown -R admin:shared /sharedData
chmod -R 2775 /sharedData
But when usr1 creates a new file in /sharedData it has rw-r--r-- permissions and is owned by usr1:shared, and usr2 is unable to modify it.
Suggestions please
Thanks in advance
Offline
I belive that there is a special variable that decides the new file permissions - I can't remember the name, but IIRC it's oppocite from the octal permissions so that the variable value of 000 means permissions of 777 and a variable value of 777 means permissions of 000 if you understand what I mean.
Offline
If I understand what you want, you need to:
1. Create the shared directory (say sharedfiles).
2. as root issue the command chmod 2770 sharedfiles (this will make the directory shared by all the users in a group with RWX )
3. issue chown root:groupname sharedfiles ( this gives ownership of this directory to root and the particular groupname you have selected )
4. Add the users you want to share the files to the same groupname
Notice that if a user in the group create a sub-directory the subdirectory will only be accessible by that user.
Hope this helps.
Offline
You are right jaboua the new file permissions are set with umask. A default value of 022 is set in /etc/profile. Sadly umask sets new file permissions globaly, not in a specific directory.
ralvez, you understand right what I want and as you pointed out the problem is that if a user in the group create a sub-directory the subdirectory will only be accessible by that user.
I would like to be able to set non restrictive new file and directory permissions in the shared directory.
Thanks for your suggestions
Offline
Pages: 1