What is the use of /etc/gshadow file in Linux?

In this article, you will learn about What is the use of /etc/gshadow file in Linux?

The /etc/gshadow file is readable only by the root user and contains an encrypted password for each group, as well as group membership and administrator information. The information about each group’s separated by a colon. This is not an important file nowadays. The system admin uses it rarely.

cat /etc/gshadow

You can find below the picture important. Here, you can see all the fields. These fields are separate.

gshadow file in Linux
gshadow file format

1. Group Name

This is the name of the group. When you create a new user without defining a group name, the system automatically assigns the group name with the same as the user name.

2. Encrypted Password Of Group

The encrypted password for the group. If set, non-members of the group can join the group by typing the password for that group using the newgrp command. If the value of this field is ! then no user is allowed to access the group using the newgrp command. A value of !! is treated the same as a value of! However, it also indicates that a password has never been set before. If the value is null, only group members can log into the group.

3. Group Administrator

All the members of the group, listed here with a comma. You can add or remove group members using the gpasswd command

4. Group Members

All the members of the group listed here are regular members. But, there is a comma to separate them, i.e. a non-administrative member of the groups.

Conclusion

In this tutorial, we learn about the /etc/gshadow file in Linux. This file is not important because it has information related to the user’s group password. Just be familiar with this file. I hope, you understand but if you have any questions, you can ask in the comment section.

Also, you can read

Leave a Reply