View all users and all user groups in linux (including how to add)

Source: Internet
Author: User

In linux, view all users and all user groups (including how to add) groups, view the group members of the currently logged-on users, groups gliethttp, and view the group of gliethttp users, view the current username/etc/group in the whoami group. The file contains all usernames in the/etc/shadow and/etc/passwd systems. 1./etc/group explanation; the/etc/group file is the configuration file of the user group. It contains the user and user group, and shows which user group or user group the user belongs, because a user can belong to one or more different user groups, users in the same user group 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. If the root user opens the read and write permissions for a file, 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 it; 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. the/etc/group content is analyzed in detail. The/etc/group content includes the User Group, User group password, GID, and User contained in the User group ), one record for each user group. The format is group_name: passwd: GID: user_list. Each record in/etc/group is divided into four fields: first field: User group name; Field 2: user group password; Field 3: GID field 4: User List, separated by commas (,). This field can be blank; if the field is blank, the user group is the GID user name. ///////// Add group name: groupadd group name view information of all groups vi/etc/group or cat/etc/group view all groups and their user information cat/etc/passwd add USER command: useradduseradd-g group name username set password: passwd Username

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.