The passwd file contains basic information about each user's account. This file contains a one-line entry for each authorized user, of the form:
username:password:uid:gid:gcos-field:home-dir:login-shell
where
The passwd file can also have lines beginning with a `+' (plus sign) which means to incorporate entries from the Network Information Service (NIS). There are three styles of + entries in this file: by itself, + means to insert the entire contents of the NIS password file at that point; +name means to insert the entry (if any) for name from the NIS service at that point; +@netgroup means to insert the entries for all members of the network group netgroup at that point. If a +name entry has a non-null password, gcos, home-dir, or login-shell field, the value of that field overrides what is contained in the NIS service. The uid and gid fields cannot be overridden.
The passwd file can also have lines beginning with a `-' (minus sign) which means to disallow entries from the NIS service. There are two styles of `-' entries in this file: -name means to disallow any subsequent entries (if any) for name (in this file or in the NIS service); -@netgroup means to disallow any subsequent entries for all members of the network group netgroup.
The password file is an ASCII file that resides in the /etc directory. Because the encrypted passwords on a secure system are kept in the passwd.adjunct file, /etc/passwd has general read permission on all systems, and can be used by routines that map numerical user IDs to names.
Appropriate precautions must be taken to lock the
/etc/passwd
file against simultaneous changes if it
is to be edited with a text editor;
vipw.8
does the necessary locking.
Here is a sample passwd file when passwd.adjunct does not exist:
root:q.mJzTnu8icF.:0:10:God:/:/bin/csh fred:6k/7KCFRPNVXg:508:10:% Fredericks:/usr2/fred:/bin/csh +john: +@documentation:no-login: +::::Guest
root:##root:0:10:God:/:/bin/csh fred:##fred:508:10:& Fredericks:/usr2/fred:/bin/csh +john: +@documentation:no-login: +::::Guest
mail.1 and sendmail.8 use the gcos-field to compose the From: line for addressing mail messages, but these programs get confused by nested parentheses when composing replies. This problem can be avoided by using different types of brackets within the gcos-field; for example:
The Network Information Service (NIS) was formerly known as Sun Yellow Pages (YP). The functionality of the two remains the same; only the name has changed.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97