Introduction to UNIX User Management

To find out what user ID number you are, the id(1) command can be used:

$ id
uid=1001(me) gid=2010(mygrp) groups=2010(mygrp), 2011(dev)
$

The id(1) command indicates that the user me is user ID number 1001 and is a member of group number 2010. The user and group names are shown in brackets. These were obtained by looking up the user ID and group ID numbers in the password and group file databases, respectively.

Understanding Username and User ID Numbers

The id(1) command previously reported that username me was user ID 1001. Another term for the user ID number is the uid number. This is derived from the fact that UNIX systems today keep the user ID number in the C data type uid_t. The following summarizes these ideas:

Username me
User ID (uid) number 1001

The uid number is how the UNIX kernel knows you. Files and IPC resources that you create will have the owner set to this number.

Understanding Username root

The uid number 0 is special under UNIX. It is known as the root user ID, though it need not be named root. Another term used for this user account is super user. The 0 (zero) uid number enjoys unrestricted access to the UNIX system as a whole. This is naturally the reason that this account is very strictly guarded.

If you administer a UNIX system (possibly your own), you can be root when you want to be. While this might be fun or convenient, you should do most of your chores in a non-root account where possible. This allows the kernel to protect itself from harm when accidents occur (and they will).

The Group Name and Group ID Numbers

In the same way that the uid number refers to a username, the group ID number is used by UNIX to refer to a group name. The C data type gid_t is used for group numbers. Consequently, the group ID number is frequently referred to as the gid number.

The group file permits one user to be a member of multiple groups. This permits more flexibility in giving out access, since users can frequently be members of several functional groups.

Understanding gid Zero

Like the uid value of zero, the gid value of zero grants unrestricted access to resources at the group level. While this is not the same as being the super user, it still grants dangerous access. Consequently, this group is usually granted only to the root account, or a special administration account.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.60.192