LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-25-2009, 10:43 PM   #1
pintudelhi
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
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,
 
Old 08-25-2009, 10:53 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
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?
 
Old 08-25-2009, 11:17 PM   #3
pintudelhi
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
permissions given to share folder in 770 and root is the owner.
thanks,
 
Old 08-25-2009, 11:23 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by pintudelhi View Post
permissions given to share folder in 770 and root is the owner.
thanks,
And the group? that's the question at hand.
 
Old 08-25-2009, 11:26 PM   #5
pintudelhi
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
friends.

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

Last edited by pintudelhi; 08-25-2009 at 11:36 PM.
 
Old 08-25-2009, 11:48 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
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.
 
Old 08-26-2009, 12:11 AM   #7
pintudelhi
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks a lot.
 
Old 08-26-2009, 12:41 AM   #8
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 675

Rep: Reputation: 136Reputation: 136
Quote:
Originally Posted by pintudelhi View Post
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 ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to share files and directory without group and world access Z038 Linux - General 8 08-11-2009 11:49 PM
Group quota not limiting for users not identical to the group? jalexxi Linux - Server 1 03-10-2009 01:44 AM
permissions not recognizing group or assigned users to group blckspder Linux - Server 1 07-28-2008 11:32 AM
I want a group to nice and renice the processes of other users of the same group tim_c Linux - Newbie 1 01-05-2007 06:39 AM
samba - users can see system files etc when accesing share t3___ Linux - Software 8 01-08-2004 02:31 AM


All times are GMT -5. The time now is 08:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration