views:

88

answers:

4

This is probably a dup (but did not find it..)

When you type ls -l in unix you get output like this:

% ls -l
total 48
-rwxr--r--   ... change*
-rwxrwxrwx   ... checkVersion*
-rwx------   ... info*

I know that the first group of rwx sets the users permisions and the last group sets "everyone else's" permisions. I think that the second rwx group sets the "group"s permissions.

How can I tell people who are in the group? What group am I in? Can I create new groups? Where are the groups defined on my machine?


Edit: Can I modify groups by modifying the /etc/groups file or do I need to do it with a command?

A: 

check out the /etc/passwd file. it has your users. then check out the /etc/group file. it has the groups with unique id's

group-name:x:group-number:user1,user2
David
+1  A: 

The groups are defined in the /etc/group file. You'll find a listing of the groups and the accounts that are members of each group there.

The unix groups command tells you what groups your account is in.

Hubble:~ $ groups
staff _developer _lpoperator _lpadmin admin localaccounts everyone
Fred
+1  A: 

To know which groups you are in type

groups

on the console.

The groups members are listed in /etc/group

klez
+2  A: 

You can edit group in /etc/group but it's really better to use system commands like :

  • groupadd to create some groups
  • usermod to operate on user and especially add users to group

Here is a sample that append yoda user to jedi group :

  • usermod -A jedi yoda

see the manual of each command for usage :

  • man groupadd
  • man usermod
Cicatrice