Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the role of valid user groups and initial user groups in Linux

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What is the role of the effective user group and the initial user group in Linux? for this question, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

1. The structure of / etc/group file

2. / description in the etc/group file

Section 1 is the account name, which matches the paragraph 1 in the / etc/passwd file

Segment 2 is a group password, which generally does not need to be set.

Paragraph 3 is GID.

Paragraph 4 is a list of members in the group, separated by a comma in English

For example, there are two users mail and postfix in the default mail group

3. Query the contents of oracle users in the passwd,shadow,group file

4. On this test machine, the running result of the command grep / etc/passwd / etc/shadow / etc/group is as follows:

Copy the contents to the clipboard

/ etc/passwd:oracle:x:54321:54321::/home/oracle:/bin/bash

/ etc/shadow:oracle:$6$ yxkNIulf$nYTPPqi/VgXFh6QdH4yZAHAB5NMz7CimNITDUUpUPKZYr0.m.KrZNcfkDX16O3C9puotrCMH2IKY5Kjfl.blh/:16785:0:99999:7:::

/ etc/group:dba:x:54322:oracle

5. Valid user group (effective group) and initial user group (initial group). The permissions of this initial user group are handled according to the permissions of the initial user group for the files that already existed before the system startup. The fourth paragraph of the passwd file is the initial user group, and the user logs in to the system with the permission of this group.

6. Valid user group (effective group)

If it is a new file created after the system starts, does the permission inherit the initial user group or the valid user group? Linux is a valid user group. how to query the current user's valid user group?

# # use the groups command. Note that this is group+s.

# # Note that if the groups command has more than one output, the first output is a valid user group.

7. How to modify the valid user group of the current user?

Use newgrp+ group name

# if the current user is root, if you enter the command: newgrp users

# modify the valid user group of the current user root

# the result of using groups user output is

Users root

This is the answer to the question about the role of the effective user group and the initial user group in Linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report