Overview #
Passwd is one of the POSIX Databases used in POSIX systems to represent the users.The /etc/passwd file is a text file with one record per line, each describing a user account. Each record consists of seven fields separated by colons. The ordering of the records within the file is generally unimportant.
Field explanation[1]#
An example record may be:jsmith:x:1001:1000:Joe Smith,Room 1007,(234)555-8910,(234)555-0044,email:/home/jsmith:/bin/shThe fields, in order from left to right, are:
Passwd and LDAP#
Field | LDAP Attribute | Comment |
---|---|---|
Login name | Uid | The first field is the user name, i.e. the string a user would type in when logging into the operating system: the logname. Each record in the file must have a unique user name field. |
Password Specification Entry | N/A | The second field stores information used to validate a user's password; however in most modern uses this field is usually set to "x" (or some other indicator) with the actual password information being stored in a separate ShadowAccount password file. Setting this field to an asterisk "*" is the typical way to deactivate an account to prevent it being used. |
Numerical user ID | uidNumber | The third field is the user identifier, the number that the operating system uses for internal purposes. It does not have to be unique. |
Numerical group ID | gidNumber | The fourth field is the group identifier. This number identifies the primary group of the user; all files that are created by this user may initially be accessible to this group. |
User name or comment field | gecos | The fifth field, called the Gecos field, is commentary that describes the person or account. Typically, this is a set of comma-separated values including the user's full name and contact details. |
User home directory | homeDirectory | The sixth field is the path to the user's home directory. |
Optional user command interpreter | loginShell | The seventh field is the program that is started every time the user logs into the system. For an interactive user, this is usually one of the system's command-line interpreters (shells). |
So from LDAP, you can think of the fields as:
loginname:password:uidNumber|defaultgidNumber:gecos:homeDirectory:loginShell
Some Examples#
The "x" implies that a shadow is used.jwilleke:x:52658:280:Jim Willeke, 213-449-7111:/home/jwilleke:/usr/bin/ksh
Below the "*" implies the entry is external to the host.
scott:*:1001:100:Aaron Scott Willeke:/home/scott:/bin/bash
LDIF entries for passwd and shadow#
LDIF entries for passwd and shadowMore Information#
There might be more information for this subject on one of the following:- Compat
- DIT Locations For NIS
- GidNumber
- NIS Maps And LDAP Attributes
- NSCD
- Name Service Switch Types
- Password Specification Entry
- Shadow
- UidNumber
- [#1] - http://www.cyberciti.biz/faq/understanding-etcpasswd-file-format/
- Retrieved 2013-02-09