Details of /etc/passwd file in Linux
In Unix-like operating system the user account information’s are stored in ” /etc/passwd ” file.It is a text file which is a required for user login. This /etc/passwd file contains the system user account list with their some valuable information of that users.This file have read permission for all local users,but write permission is given only to the root user.
The “/etc/passwd” file contains totally seven fields. Each and every user of the system have their account information in a separate single line. The fields in the line are separated by the colon (:) symbol.
The format of passwd file is shown below
username:pwd[y or n]:uid:gid:usrinfo:homepath:shell
Informations stored in “/etc/passwd” file look like below
In the above Example, the passwd file entry shows the user name as test user having passwd (since ‘x’ denotes user having password), their UID is 1481 and GID is 1482,The Information of the user is mentioned as “This is a test user”, user home path is /home/testuser and their login shell in /bin/bash.