LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to share files between users from same group (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-share-files-between-users-from-same-group-750247/)

pintudelhi 08-25-2009 09:43 PM

How to share files between users from same group
 
I need help,its urgent. I am just a beginner to unix and need to know how can two users form a same group can share files.
As a root I have created a directory called "share" and given permissions using chmod and chgrp. Two users ? user1 and user2 are in the same group called "friends".
Now the problem I am getting is- user1 and user2 can access the file in the dir "share". But if user1 creates a file then user2 cannot edit it.
I want both the user?s can create and edit each others files.
I have changed user1 and user2 .bash_profile file and given a umask 007.
Any help on this,its urgent.
Regards,

i92guboj 08-25-2009 09:53 PM

I don't think it's that urgent, I think it's homework, so I will only give you some directions.
  • what is the owner:group of the "share" directory?
  • what are the permissions of the folder for the group?

pintudelhi 08-25-2009 10:17 PM

permissions given to share folder in 770 and root is the owner.
thanks,

i92guboj 08-25-2009 10:23 PM

Quote:

Originally Posted by pintudelhi (Post 3657610)
permissions given to share folder in 770 and root is the owner.
thanks,

And the group? that's the question at hand.

pintudelhi 08-25-2009 10:26 PM

friends.

i can share the files.
but i want that -files that are created should be group writable by default.

i92guboj 08-25-2009 10:48 PM

Oh, I see, so the problem is that the umask is not working for some reason. Note that umask just sets a value, it doesn't directly enforce anything. In other words, applications can save the files with whatever permissions they think it's best, just like chmod can also change them.

Your best bet would be to monitor that directory with inotifywait, for file creation event, and each time a new file is created, chmod it (and chown it if necessary). This task can run as root on the background, and that way you don't have to rely on the users individual umasks.

pintudelhi 08-25-2009 11:11 PM

Thanks a lot.

Valery Reznic 08-25-2009 11:41 PM

Quote:

Originally Posted by pintudelhi (Post 3657583)
I need help,its urgent. I am just a beginner to unix and need to know how can two users form a same group can share files.
As a root I have created a directory called "share" and given permissions using chmod and chgrp. Two users ? user1 and user2 are in the same group called "friends".
Now the problem I am getting is- user1 and user2 can access the file in the dir "share". But if user1 creates a file then user2 cannot edit it.
I want both the user?s can create and edit each others files.
I have changed user1 and user2 .bash_profile file and given a umask 007.
Any help on this,its urgent.
Regards,

Did you consider using some kind of version control instead ?


All times are GMT -5. The time now is 03:20 PM.