Linux users and user groups, linux User Groups

Source: Internet
Author: User

Linux users and user groups, linux User Groups
Users and user groups
1./etc/group
Group Name: x: group number: User List
Group No. 1-499 Reserved System No.
Group No. 500-User Creation

2./etc/gshadow
Group Name: group password: Group Administrator: User List

3./etc/passwd
Username: Password placeholder: user No.: User Group No.: Comment: main directory: shell Type

4./etc/shadow
Username: Password :::::

5. Group
Groupadd group name
-G group ID # specify group ID
Groupmod-n new group name original group name
-G group no. Original group name # modify group no.
Groupdel group name

6. User
Useradd-g group name Username
-G: Specifies the group name.
-D specifies the home Directory of the user.
# If no group is specified, a group with the same user ID will be created.
Usermod-c comment User Name
-L new username original username # modify Username
-D directory # modify the home Directory
-G # modify the group
Userdel-r user name
-R # Delete All User Files

Touch/etc/nologin # temporarily prohibit non-root Account Login

7. Other commands
Passwd-l User Name
-L lock user
-U unlock
-D logon without a password

Gpasswd-a username group name ,...
-D remove the affiliated group
# Add a user to a group (affiliated group)

Newgrp affiliated group # Switch to the affiliated group (requires the group password)

Useradd-g main group-G affiliated group 1,... Username

Su username # Switch user

Id Username

Groups User Name

Chfn username # Set User details

Finger username # Show user details

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.