top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are seven fields in the /etc/passwd file.

+1 vote
336 views
What are seven fields in the /etc/passwd file.
posted Mar 3, 2014 by Bhani Bhosle

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

These are
name, password, UID, GID, comment, home directory, shell

Each of these fields must be separated by a colon even if they are empty.

Description
Name is the user's login name. Each such name must be unique string.

The password field originally contained an encrypted login password. However, for security reasons, the encrypted passwords are now contained on another file, /etc/shadow, that cannot be read by ordinary users2. This field now merely contains the letter x to indicate that a password has been assigned to the user and is required for authentication. If this field is empty, the user can log in without a password.

User ID is the user's unique numeric identification number, which is used by the system for access control. Zero is reserved for the root account, and one through 99 are reserved for other predefined accounts. 100 through 999 are available for ordinary users and groups.

Group ID specifies the user's principal group identification number. This is usually the same as the user ID.

comment for historical reasons. This field can be empty, in which case there is no space between the two delimiting colons. Alternatively, it can contain multiple entries, each separated by a comma.

Home directory is the full path (i.e., the location relative to the root directory) of the user's home directory. This is the directory that the user is first in when logging into the system and which contains programs and configuration files specific to that user.

Shell is the full path of the default shell for the user. A shell is a program that provides a text-only user interface and whose main purpose is to execute commands typed in by a user and display the results. The default shell on Linux is bash, whose absolute path is /bin/bash.

answer Mar 3, 2014 by Salil Agrawal
Similar Questions
0 votes

I am a python script which tries to create a file under directory /etc/ but I am getting the error as

IOError: [Errno 13] Permission denied: '/etc/file'

Any Idea how to create a file in /etc as non-root user?

...