LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 02-23-2009, 10:02 AM   #1
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Rep: Reputation: 41
Question Groups..Users..Permissions..


Hi All,

Could anybody please let me know about the below simple but confusing question :
"There are 3 groups(say abc, xyz and ijk) and there are four users (say u1, u2, u3 and u4). How to assign 1 user to each group?? How can we configure users and groups so that usres of groups abc and efg only can access each others data ?? Finally, how to configure the fourth user in such a manner that he can access the files of all the other users??"

It is slight confusing for me , and I got different errors while trying to attempt this....

Thank You in advance..
Kapil
 
Old 02-23-2009, 10:36 AM   #2
gergely89
Member
 
Registered: Feb 2009
Posts: 100

Rep: Reputation: 21
Each user is also a group. Users can share groups, by adding the user to the group of another user. A separate definition of groups is possible, but not necessary.

The Linux Documentation Project (http://tldp.org) has good material on generic UNIX and Linux concepts for system administrators. Or see the man files for useradd (or adduser on some systems) and groupadd.

linux

Last edited by gergely89; 02-27-2009 at 11:47 PM.
 
Old 02-23-2009, 11:11 AM   #3
adnankhawer
LQ Newbie
 
Registered: Mar 2008
Location: Pakistan
Distribution: Red Hat, Kubuntu, Suse
Posts: 13

Rep: Reputation: 0
Quote:
How to assign 1 user to each group??
open /etc/group file

abc:x:604:u1

you can add more by separating with , u1,u2,u3. 604 is group ID which can be different.

Quote:
How can we configure users and groups so that usres of groups abc and efg only can access each others data ??
for this purpose
1. you have to make another group then assign the users of abcand efg to that group.
2.then make a shared directory (say /home/shareit) for new shared group (say mygrp)
3. change ownership so that only new group members can access this directory.

#chown nobody.mygrp /home/shareit

4. change permission bits
#chmod 770 /home/shareit
5. set SGID bit

#chmod g+s /home/shareit

I think it will work!

Bye
 
Old 02-23-2009, 11:36 AM   #4
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Question

Hi Adnankhawer,

This information is really helpful, but I am getting a little confused. Let me tell you what I did till now :
a) created three groups using groupadd command
b) created four users using useradd command
c) assign 1 user to each group using command 'usermod -G abc u1'...respec
d) assign users u1 and u2, to same group say group xyz, using same command.
e) while I tried accessing files, I got 'permission denied' error. So I changed permission to users to 770 and files within users to 660.
Now I can access files of users u1 and u2 as they belong to same group.

But still, I am facing problems in creating another user u4 who can access all the files of all the users.
Also, I didn't tried adding users to same group directly from /etc/group file. I will try that, as it seems easy and quick way of doing this.
Also could you please explain this additional directory concept ???

Thank you,
Kapil


Quote:
Originally Posted by adnankhawer View Post
open /etc/group file

abc:x:604:u1

you can add more by separating with , u1,u2,u3. 604 is group ID which can be different.



for this purpose
1. you have to make another group then assign the users of abcand efg to that group.
2.then make a shared directory (say /home/shareit) for new shared group (say mygrp)
3. change ownership so that only new group members can access this directory.

#chown nobody.mygrp /home/shareit

4. change permission bits
#chmod 770 /home/shareit
5. set SGID bit

#chmod g+s /home/shareit

I think it will work!

Bye
 
Old 02-23-2009, 11:41 AM   #5
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Question

Hi gergely89,

Thank You for your reply, but sorry to say that I didn't get anything from your reply. I am not so through with Linux till now, although I am trying hard to do so.
Could you please explain in somewhat more detail, what you were trying in your last reply....

Thank You again..
Kapil.


Quote:
Originally Posted by gergely89 View Post
Each user is also a group. Users can share groups, by adding the user to the group of another user. A separate definition of groups is possible, but not necessary.

The Linux Documentation Project (http://tldp.org) has good material on generic UNIX and Linux concepts for system administrators. Or see the man files for useradd (or adduser on some systems) and groupadd.
 
Old 02-23-2009, 11:59 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
I am not following the details of this, but my sense is that you may be confusing yourself. For example, it makes no sense to have a group with one user.

First, decide the broadest privileges you want to have---this gets assigned to "others" (the third column of permissions).

Second, decide the permissions for the group that is assigned to the file or directory. Anyone who needs those permissions can be added to that group.

Finally, the highest level of permissions typicall go the owner of the file (directory)

I think you can do fancier stuff by creating soft links, but first be sure you are clear on the basics.
 
Old 02-23-2009, 12:08 PM   #7
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Question

Hi pixellany,

Actually, I am supposed to try this with 16 users and 3 groups. But on my machine, i want to try this with few users and same three 3 groups.
maybe I might be confusing myself, but I really want to figure this out asap. Any clear suggestion will be more than helpful.

Thank You,
Kapil.


Quote:
Originally Posted by pixellany View Post
I am not following the details of this, but my sense is that you may be confusing yourself. For example, it makes no sense to have a group with one user.

First, decide the broadest privileges you want to have---this gets assigned to "others" (the third column of permissions).

Second, decide the permissions for the group that is assigned to the file or directory. Anyone who needs those permissions can be added to that group.

Finally, the highest level of permissions typicall go the owner of the file (directory)

I think you can do fancier stuff by creating soft links, but first be sure you are clear on the basics.
 
Old 02-23-2009, 12:20 PM   #8
adnankhawer
LQ Newbie
 
Registered: Mar 2008
Location: Pakistan
Distribution: Red Hat, Kubuntu, Suse
Posts: 13

Rep: Reputation: 0
Hi Kapil,

Let me tell u what I know about users and groups;

Each user has its own file/directories no user can access files/Dir of other user even if it belongs to same goup. you have to assign permission to user for access to other files/dir; try

#man chown

#man chmod and find sticky bit help on directory, as i wrote chmod g+s /.../...

Quote:
I am facing problems in creating another user u4 who can access all the files of all the users.
for this purpose, I will try or ask to Linux Gurus they are most respected persons in Linux Community!!!!!!!!!

Bye
 
Old 02-23-2009, 03:57 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by kapilbajpai88 View Post
Actually, I am supposed to try this with 16 users and 3 groups.
Homework?
 
  


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
problem with users, groups, and permissions. symo0009 Linux - General 4 01-24-2006 12:54 PM
users/groups and permissions.... muman Linux - Newbie 2 09-21-2004 12:20 PM
users, groups, and permissions mcd Linux - Newbie 3 05-26-2004 10:06 PM
Users, groups, permissions - specific task question Doctafonk Linux - General 2 04-21-2004 10:05 PM
Saving users, groups and permissions in Red Hat 9 ferrantepunto Linux - Software 2 12-03-2003 02:26 PM


All times are GMT -5. The time now is 08:51 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