sections in this module City College of San Francisco - CS260A
Unix/Linux System Administration

Module: Users and Authentication
module list

The passwd, group files

Possibly the most important configuration files on the system are the passwd file (/etc/passwd) and the group file (/etc/group). The existence of a user on the system is defined by the existence of an entry in the passwd file. Similarly, the existence of a group on the system is defined by an entry in the group file.

The /etc/group file

Remember, each user on a Unix or linux system is a member of one or more groups. One of these groups is the user's default (or primary) group: that is the group that is assigned to any new data created by the user. The world-readable group file defines the groups available to place users (and files) in. Entries have the format

gname:gpass:gid:members

where

Some systems use an enhanced package for group management called gshadow. It uses the group password to create group administrators who can alter group members and keeps additional information (including the passwords) in the /etc/gshadow file. We will not cover gshadow. The interested reader is referred to the linux man page on gpasswd(1).

The /etc/passwd file

Arguably the most important file on the system, each user is defined by the existence of an entry in the passwd file. Entries have this format:

uname:password:uid:gid:gecos:home:shell

where

Non-local accounts

Note: currently our linux network at CCSF uses accounts on NIS. On these systems special tools must be used to change your shell, password, and finger information. They are named the same as the standard programs with the prefix yp - yppasswd, ypchsh, ypchfn. (The yp prefix comes from the old name for NIS (yellow pages)). In addition, ypcat is used to access the network NIS account databases. ypcat is a multi-function program, but, our purposes, it is most useful to display the NIS passwd and group file:

local command
NIS counterpart
cat /etc/passwd
ypcat passwd.byname
cat /etc/group
ypcat group.byname

If you are looking for a particular item, just use grep to filter the output.

NOTE: NIS often allows normal uses to display encrypted passwords from the server's shadow file in this manner! In other words, ypcat passwd.byname will display  shadow passwords if NIS is not configured carefully!

We will discuss non-local accounts more completely in the section on authentication.

Preview question: How do you create a password for yourself when you visit a new site on the Internet? Do you use the same scheme when you are creating a linux password? Would you use the same scheme (or even the same password(!) for the root account? How do you keep track of all these passwords? 

Prev This page was made entirely with free software on linux:  
the Mozilla Project
and Openoffice.org      
Next

Copyright 2012 Greg Boyd - All Rights Reserved.