Linux “Passwd’ file

April 11, 2009

File Structure of  the file /etc/passwd
It stores essential information required during login i.e. user account information.It contains one entry per line for each user (or user account) of the system. All fields are separated by a colon ( : ) symbol. Total seven fields as follows.

Generally, passwd file entry looks as follows :

Name:Password: UserID:PrincipleGroup:Gecos: HomeDirectory:Shell

1. Username: It is used when user logs in. It should be between 1 and 32 characters in length.

2. Password: An x character indicates that encrypted password is stored in /etc/shadow file.

3. User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for administrative and system accounts/groups.

4. Group ID (GID): The primary group ID (stored in /etc/group file)

5. User ID Info: The comment field. It allow you to add extra information about the users such as user’s full name, phone number etc. This field use by finger command.

6. Home directory: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory becomes /

7. Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell. Please not it does not have to be a shell.

Caution: The permission on the /etc/passwd file should be read only to users (rw-r—r–) and the owner must be

root: $ ls -l /etc/passwd

Output: -rw-r–r– 1 root root 1941 Oct 13 02:08 /etc/passwd

  • /etc/passwd is a text file that contains the attributes of (i.e., basic information about) each user or account on a computer running Linux or another Unix-like operating system.
  • The permissions for /etc/passwd are by default set so that it is world readable, that is, so that it can be read by any user on the system1. The file can be easily read using a text editor (such as gedit or vi) or with a commandcat, which is commonly used to read files, i.e., cat /etc/passwd such as

Entry Filed under: linux. Tags: .

1 Comment Add your own

  • 1. How I Lost Thirty Pounds in Thirty Days  |  May 4, 2009 at 1:15 pm

    Hi, nice post. I have been thinking about this topic,so thanks for writing. I’ll certainly be coming back to your posts.

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


My Profile


# Software Eng. # Worked with C,C++, JAVA and PHP. #Love to play with codes. # Mostly like to do programming with 'C'. # I am not a CODER, but a DEVELOPER.

Admin Panel..

Life Cycle

April 2009
S S M T W T F
« Dec   Jul »
 123
45678910
11121314151617
18192021222324
252627282930  

Clouds

cakephp codeIgniter desktop htaccess jscript linux mixed my words php regular expression

Just Posted

TOP R@TED

TaGs

cakephp codeIgniter desktop GP htaccess image upload installation jscript linux news password Personal Life php regular_Xpression script session validation

Archives

Top Posts

CoMmEnTs

Blog Stats

My Web Links

Web Links

RSS Xperts.PHP