Linux Account group deletion and other related operations

Source: Internet
Author: User

Linux Account group deletion and other related operations

1. userdel [-r] username: delete a user. The data you have thought of includes:/etc/passwd,/etc/shadow,/etc/group,/etc/gshadow, /home/username,/var/spool/mail/username, parameter

1) delete it together with the user's home directory

2. finger [-s] username: queries user-related information, parameters,

1)-s: only lists the user's account, full name, terminal, and logon time.

2)-m: list the users who are connected to the following account, instead of using partial comparison (including full name)

Without parameters, the username of the currently logged on host is listed by default.

3. chfn [-foph] [account name]: modifies the output information and parameters of finger,

1)-f: followed by the complete name

2)-o: the room number of your office

3)-p: office phone number

4)-h: home phone number

4. chsh [-ls]: Change the shell directory, parameters,

1)-l: list the shells available on the current system, which is actually the content of/etc/shells.

2)-s: Set and modify your own Shell.

5. id [user name]: query the user's various id information. If the user name is not followed, it indicates querying the current user's various id information.

6. groupadd [-g gid] [-r] group name: Add group, parameter,

1)-g: Followed by a specific GID, used to directly give a GID

2)-r: Create a system group, which is related to/etc/login. defs.

7. groupmod [-g gid] [-n group_name] group name: Modify group-related parameters, parameters,

1)-g: Modify the existing GID

2)-n: Modify the existing group name

8. groupdel [groupname]: before deleting a specified group, make sure that the group is not used as the initial group (that is, the Group id recorded by the user's GID)

9. gpasswd groupname; gpasswd [-A user1,...] [-M user3,...] groupname; gpasswd [-rR] groupname: Create A group administrator, parameter

1) if no parameter exists, a password (/etc/gshadow) is given to groupname)

2)-A: Hand over the groupname's main control permission to the user behind the management (the Group Administrator)

3)-M: add some accounts to this group.

4)-r: remove the groupname password.

5)-R: invalidate the password of groupname

The preceding operations can be performed by the system Administrator root. Group Administrator can perform the following operations:

Gpasswd [-ad] user groupname: parameter,

6)-a: Add a user to the groupname group.

7)-d: Remove a user from the groupname group.

10. SGID permission: When the directory has the SGID permission, it means that all groups of files created under this directory are the same as those in this directory.

This article permanently updates the link address:

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.