Advanced commands for Linux user groups and user groups

Source: Internet
Author: User

1. User lock: Passwd-l user1

2. Unlock User: Passwd-u user1

3. User no Password registration: passwd-d user1

4. Add to the secondary user group: Gpasswd-a user1 boss (group name)
Remove user to Secondary user group: Gpasswd-d user1 boss


5. Switch to the Boss user group: Newgrp boss (after User1 login), you may want to enter a user group.

6. Add users to the main user group and to the secondary user group:
Useradd-g group01-g GROUP02,GROUP03

7. Group user group plus password: gpasswd newpasswd renewpasswd

8. Switch user's identity: Su username or su after the user name, that is, the switch user name.

9 Current Login user name: WhoAmI

ID + username. Indicates that the specified user information, including user number, user name, is displayed. Primary group number and name, subordinate group list.

Groups + Username. Displays all groups for that user.

Advanced commands for Linux user groups and user groups

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.