File /etc/passwd and /etc/group on Linux

Linux is an open source one is more preferred by many people. If you are creating or modifying user in linux, then all the information will be stored in the file /etc/passwd.
/etc/passwd,/etc/group,/etc/passwd file
File /etc/passwd is a file that contains a list of users on the Linux operating system, is usually separated using different lines. Each line carries information such as:
  • Username - in accordance with its name, contains the name of the user who entered during the login process.
  • Password contains the keywords used for encryption, in order to run the process.
  • User ID (UID) is a unique number corresponding to the username, to differentiate it from the other username.
  • Group ID (GID) is a unique number corresponding to the group, to differentiate it from the other group.
  • GECOS is the name of history and it is optional to store additional information.
  • Home directory is a directory to hold the contents of the user.
  • Shell is a program that runs itself when there are users who log into the system.
Sample contents of the file /etc/passwd:
# Cat /etc/passwd
root: x: 2:2: root :/root :/bin/bash
The above example shows the information that the root user has a password, UID and GID: 2. It has a home directory: /root/ and use the shell: /bin/bash.

File /etc/group

File /etc/group is a file that lists the group in linux operating system and separated using different lines. Each line consists of 4 columns and carry information such as:
  • Group name is the name of the group that has been created.
  • Group passwords contain keywords from the group that is used for encryption.
  • Group ID (GID) is a unique number that serves to distinguish with the other group.
  • Member List consists of a collection of users who are members of the group.
Sample contents of the file /etc/group:
# Cat /etc/group
general: x: 111: USR1, usr2, usr3
The example above shows that the general group using passwords x, has GID: 111 and members usr1, usr2 and usr3.

Related post :

No comments :