passwd(4) passwd(4)NAME passwd - password file SYNOPSIS passwd DESCRIPTION passwd contains the following information for each user on the system: name Specifies the user's login name; contains no uppercase characters and must contain more than eight characters. password Specifies the user's encrypted password as well as aging information. numeric-user-ID Specifies the user's ID in the system and it must be unique. If zero, an account with root privileges is created. The highest value that can be used for a user ID is 60000. The upper limit is established in the file /usr/include/limits.h. numeric-group-ID Specifies the number of the group that the user belongs to. real-name Specifies detailed information about the user, such as the user's place of work, office and home phone numbers, and so on. For historical reasons, this field is called the ``GCOS'' field. default-working-directory Specifies the directory that users are positioned in after logging in to the system. This is known as the ``home'' directory. shell Specifies the program to use as the shell when the user logs in. The user's real-name field can contain an ampersand (&), meaning ``insert the login name.'' The password file is an ASCII file. Each field within each user's entry is separated from the next by a colon. The entry for each user is separated from the next by a newline. If the password field is null, no password is demanded; if the shell field is null, /bin/sh is used. January 1992 1
passwd(4) passwd(4)This file resides in directory /etc. Because of the encrypted passwords, it has general read permission and can be used, for example, to map numeric user IDs to names. The encrypted password consists of 13 characters chosen from a 64-character alphabet (., /, 0-9, A-Z, a-z), except when the password is null, in which case the encrypted password is also null. Password aging is effected for a particular user if his or her encrypted password in the password file is followed by a comma and a non-null string of characters from the list just given. (Such a string must be introduced in the first instance by the user logged in as root.) The first character of the age, such as M, denotes the maximum number of weeks for which a password is valid. A user who attempts to login after his or her password has expired will be forced to supply a new one. The next character, such as m, denotes the minimum period in weeks that must expire before the password can be changed. The remaining characters define the week (counted from the beginning of 1970) when the password was last changed. (A null string is equivalent to zero.) M and m have numerical values in the range 0-63 that correspond to the 64-character alphabet listed earlier (that is, / = 1 week; z = 63 weeks). If m = M = 0 (derived from the string . or ..), the user will be forced to change his or her password the next time he or she logs in (and the ``age'' will disappear from his or her entry in the password file). If m > M (signified, for example, by the string ./), only the user logged in as root will be able to change the password. The passwd file can also contain a line beginning with a plus sign (+), which means that entries from the Network Information Service (NIS, formerly called ``Yellow Pages'') should be incorporated. There are three styles of + entries: alone, + 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 password file at that point; +@name means to insert the entries for all members of the network group name at that point. If a + entry has a non-null password, directory, GCOS, or shell field, it will override the contents of the NIS password file. The numeric user ID and group ID fields cannot be overridden. EXAMPLES Here is a sample /etc/passwd file: root:q.mJzTnu8icF.:0:10:God:/:/bin/csh ja:6k/7KCFRPNVXg:508:10:Jerry Asher:/usr2/ja:/bin/csh +melissa: +@documentation:no-login: 2 January 1992
passwd(4) passwd(4)+:::Guest In this example, there are specific entries for users root and ja, in case NIS is out of order. The user melissa will have her password entry in NIS incorporated without change; anyone in the netgroup documentation will have his or her password field disabled, and anyone else will be able to log in with his or her usual password, shell, and home directory, but with a GCOS field of Guest. 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 does the necessary locking. FILES /etc/passwd File containing user information SEE ALSO crypt(3), getpwent(3), group(4) login(1), passwd(1) in A/UX Command Reference vipw(1M) in A/UX System Administrator's Reference January 1992 3