View all users and all user groups in Linux

Source: Internet
Author: User
Groups
Groups gliethttp: view the group where the gliethttp user is located and the group members
Whoami

The/etc/group file contains all groups.
All usernames in the/etc/shadow and/etc/passwd Systems

1. Explanation of/etc/group;

/Etc/group

A file is a configuration file of a user group. It contains users and user groups, and shows which user group or user group the user belongs to, because a user can belong to one or more different user groups; same use

User groups have similar features. For example, if we add a user to the root user group, this user can browse the files in the root user's home directory.
The read/write execution permission is open. All users of the root user group can modify this file. If it is an executable file (such as a script), users of the root user group can also execute the file;

User Group features provide great convenience for system administrators in system management, but security is also worth noting. For example, a user has the most important content for system management, it is best to allow users to have independent user groups, or set the permissions of files under the user to be completely private. In addition, the root user group should not easily add normal users,

2. Detailed analysis of/etc/group content

The content of/etc/group includes the user group, user group password, GID, and user included in the user group. Each user group has a record. The format is as follows:

Group_name: passwd: GID: user_list

Each record in/etc/group has four fields:

Field 1: User Group name;

Field 2: User Group Password;

Third Field: GID

Field 4: User List. Each user is separated by a comma. This field can be blank. If the field is empty, it indicates that the user group is the user name of GID;

From: http://www.51testing.com /? Uid-211244-action-viewspace-itemid-156547

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.