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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-10-2005, 01:03 PM
|
#1
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Rep:
|
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..
|
|
|
12-10-2005, 02:39 PM
|
#2
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
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 02:42 PM.
|
|
|
12-10-2005, 04:16 PM
|
#3
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Original Poster
Rep:
|
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.
|
|
|
12-11-2005, 07:01 AM
|
#4
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
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.)
|
|
|
12-11-2005, 07:58 AM
|
#5
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Original Poster
Rep:
|
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..
|
|
|
12-16-2005, 05:42 AM
|
#6
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Original Poster
Rep:
|
bump.....
Please dont mind, bumping my thread in expectations for some replies.
|
|
|
All times are GMT -5. The time now is 03:15 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|