Question: Owner vs Groups

I have used chown and chgrp. To change ownership you do eg:

chown root:root scriptname
chown admin:admin scriptname

A few questions. I know that the root: root refers to which group:owner you want it to be owned by, but what is group vs owner in the first place? I was never clear on that.

Differences

Anybody on the system can be an owner, but group will specify the resources you have access to or privileges you have. root has a group of 0 on the system meaning total access / privilege (see below for alternate setup on various unix systems). On the same token you can add a user to the system and add the user to group 0 and that user will have root rights/privileges. On a larger server, with a larger system, you will find a lot of users in different groups and when you do an

ls -lrt

total 0
drwxr-xr-x+  5 nyeates1  staff   170 Apr  5  2008 Sites
drwxr-xr-x+  6 nyeates1  staff   204 Aug  4 03:14 Public
drwx------+  9 nyeates1  staff   306 Oct 27 23:01 Movies
drwx------+  7 nyeates1  staff   238 Nov  6 12:46 Music

command on the file system you will see group and owner for different files. Now take a look at the etc/group file. You will see different groups and their group id’s and then see all the users or applications that belong to that group.

##
# Group Database
# 
# Note that this file is consulted when the system is running in single-user
# mode.  At other times this information is handled by lookupd.  By default,
# lookupd gets information from NetInfo, so this file will not be consulted
# unless you have changed lookupd's configuration.
##
nobody:*:-2:
nogroup:*:-1:
wheel:*:0:root
daemon:*:1:root
kmem:*:2:root
sys:*:3:root
owner:*:10:
everyone:*:12:
group:*:16:
staff:*:20:root
admin:*:80:root
...

For additional information see: primary_vs_secondary_groups

Alternate setups

On many UNIX-based systems (not all), the root user ignores permissions, but group 0 is not special the same way. If a file is owned by nickyeates with permissions 700, the root user can generally modify the file, but other members of group 0 cannot.

Macs are running a BSD type flavor of UNIX and the commands are different. Just as in AIX, and HP Unix. You can google mac or BSD user management or account management to get the commands.

 
technology/unix/owner_vs_group.txt · Last modified: 01.25.2009 12:31 by 71.166.39.38
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki