LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-10-2005, 02:03 PM   #1
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
2 groups for complete access over to 1 share/folder ?


I want to share a folder /documents over to two groups i.e. 'male' & 'female'.

'male' already have an access to /share1, /share2 & should also be able to access /documents folders.
'female' group should also have an access to /documents, & are already able to access /share3 & /share4 folders.

What i want is that male & female group should be able to read & write to /documents folder & it contents & files should be always be accessible by all the members of 'male' & 'female' group. No matter what the situation is.

What shall i do ?
My Query is basically how can i assign two groups to have rw access & files in result should always be accessible to all the members of these two groups.

I am already using setgid for this folder but how come its gonna cater two groups ??

-----------------------------------------------------------------------------------------------------------------------------
Only way out which i seems ok is to create a new GROUP with name of documents-users & place all the needful male & female in this group.
-----------------------------------------------------------------------------------------------------------------------------

Thanks
..amit..
 
Old 12-10-2005, 03:39 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 347Reputation: 347Reputation: 347Reputation: 347
The UNIX approch is to create a new group, place both "male" and "female" members it, and give the new group access to the directory.

Note that a user may be a mamber of as many groups as is needed. For example:
Code:
$ groups
baseuser bin disk floppy mysql torrent
is what my group membership looks like right now.

Edit: As far as I know, there's no command for creating group trees, although it wouldn't be very hard to do so in bash.

Last edited by PTrenholme; 12-10-2005 at 03:42 PM.
 
Old 12-10-2005, 05:16 PM   #3
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Original Poster
Rep: Reputation: 31
Ok.

I tried implementing it.

I created three new groups male, female & gender.
I edited /etc/group & /etc/gshadow & made male & female the member of group gender.

my /etc/group looks like this now.
gender:x:554:male,female

I've created two users male1 & female1.
male1's primary group is male.
female1's primary group is female.

Now i have created a new directory at root with the name of /commonshare & chown it to root:gender.

But when i did chmod /commonshare to 2770, male1 & female1 cannot cd to this directory.

So either i need to chmod it to 2777 for them to enter this directory but in that case any user can modify the contents & move into this directory.

Your comments.
 
Old 12-11-2005, 08:01 AM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 347Reputation: 347Reputation: 347Reputation: 347
Quote:
Originally Posted by amitsharma_26
Ok.

I tried implementing it.

I created three new groups male, female & gender.
I edited /etc/group & /etc/gshadow & made male & female the member of group gender.
Sorry. The point I was trying to make with the comment in my edit was that you can't do what you want by putting groups in other groups. (I.e., there is no tree group support.)

So, you have to put male1 and female1 (i.e., the users) into the gender group. (You don't need to change their primary group membership, just add them to the group.)
 
Old 12-11-2005, 08:58 AM   #5
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by PTrenholme
Sorry. The point I was trying to make with the comment in my edit was that you can't do what you want by putting groups in other groups. (I.e., there is no tree group support.)

So, you have to put male1 and female1 (i.e., the users) into the gender group. (You don't need to change their primary group membership, just add them to the group.)
I already mentioned that in my first post..

Quote:
Originally Posted by amitsharma_26
I want to share a folder /documents over to two groups i.e. 'male' & 'female'.

-----------------------------------------------------------------------------------------------------------------------------
Only way out which i seems ok is to create a new GROUP with name of documents-users & place all the needful male & female in this group.
-----------------------------------------------------------------------------------------------------------------------------
With this i need to create a new group for every share with such a scenario.

Is there no other way out ?

Thanks
..amit..
 
Old 12-16-2005, 06:42 AM   #6
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Original Poster
Rep: Reputation: 31
bump.....

Please dont mind, bumping my thread in expectations for some replies.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 03:09 PM
assign a file/folder two groups? student04 Linux - General 2 12-19-2004 11:47 PM
share for groups on samba 3 - ADS doesn't work ceixxx Linux - Software 0 11-06-2004 06:13 PM
howto folder/file sharing with specific groups kmhui Linux - Newbie 5 09-18-2004 08:05 PM
Get complete folder with ftp sikandar Linux - Software 6 08-22-2003 11:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:56 AM.

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