Unix permissions: how groups work on Unix

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

When you type ls -lin unix, you get output like this:

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

I know that the first group rwx sets the rights of users, and the last group sets "everyone else". I think the second rwx group sets the group permissions.

How can I tell people who are in a group? Which group do I belong to? Can I create new groups? Where are the groups defined on my machine?


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

+3
source share
4 answers

,

groups

.

/etc/group

+1

/etc/group, , :

  • groupadd
  • usermod

, yoda jedi:

  • usermod -A jedi yoda

. :

  • man groupadd
  • man usermod
+2

/etc/group. , .

unix groups , .

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

/etc/passwd. . /etc/group. id

group-name:x:group-number:user1,user2
0

Source: https://habr.com/ru/post/1742334/


All Articles