Describe /etc/passwd file in linux system with practical examples


Describe /etc/passwd file in linux system with practical examples

In this article we learn about “/etc/passwd” file in linux system that is brief description all filed of the “/etc/passwd” file, which field stores which information. It is very important file for a system administrator to manage the user account.

Passwd file is stored the /etc directory in the linux system. to view the “/etc/passwd” file we execute the below command.

 [root@localhost ~]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin

Describe /etc/passwd file in linux system with practical examples
Describe /etc/passwd file in linux system with practical examples


Explain first field of the /etc/passwd file

From the above output we saw that first filed is the username field. When we create a user the username sets in this field. When we login terminal using the username then this value compares the value which is stored in username field which is created during creation of a user.

Explain second field of the /etc/passwd file

From the above output we saw the second field is encrypted password field of the user account. Normally the encrypted password uses the DES algorithm to secure the password of an user. To do more secure of the password of an user linux is store the user password in the other file which is called /etc/shadow.

Explain third field of the /etc/passwd file

Third field indicate the user id of an specific user. This id will be unique.user id “0” indicates the root user. system is reserved userid from 0 to 500 . when we create new user it is created with user id after 500.



Explain fourth field of the /etc/passwd file

Fourth field indicated the group id of the user. When we create an user primary group is automatically created for the user if we don’t specify the primary group of the user.this field indicates the primary group id of the user.

Explain fifth field of the /etc/passwd file

Fifth field indicated the description field of the user user. In an organization when we create some users we need to mention their details to maintain the user record. This field stores these records.

Explain sixth field of the /etc/passwd file

Sixth field indicated the home directory of the user. When we create an user home directory is automatically created for the user if we don’t specify the custom home directory. This home directory is stored in this field.

Explain seventh field of the /etc/passwd file

Seventh field indicates the shell of he user. When we create an user “/bin/bash” shell is automatically created for the user. This shell is stored in this field.


Explained User management in linux with practical examples





Please Donate To Bitcoin Address: [[address]]
Donation of [[value]] BTC Received. Thank You.
[[error]]
SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment