Home  >  Article  >  System Tutorial  >  How to use usermod to set the main group and additional groups in LINUX?

How to use usermod to set the main group and additional groups in LINUX?

WBOY
WBOYforward
2023-12-28 20:11:471014browse

Today we will take a look at the method of setting the main group and additional groups by usermod in LINUX. It is very simple. Please see the detailed tutorial below.

1. Open the LINUX UBUNTU operating system, find the terminal and open the window.

How to use usermod to set the main group and additional groups in LINUX?

How to use usermod to set the main group and additional groups in LINUX?

2. After entering id, you can view all main groups and additional groups .

How to use usermod to set the main group and additional groups in LINUX?

3. The second 1000 shown here in the passwd file is the number of the main group.

How to use usermod to set the main group and additional groups in LINUX?

4. Here you can see at a glance the

group-attached permissions of the study user.

How to use usermod to set the main group and additional groups in LINUX?

5,

chrisThis user does not have the permissions of the additional group sudo, and the user cannot be created.

How to use usermod to set the main group and additional groups in LINUX?

How to use usermod to set the main group and additional groups in LINUX?

How to use usermod to set the main group and additional groups in LINUX?

6. Capital G can add

additional groups.

How to use usermod to set the main group and additional groups in LINUX?

7. Check here, there are two users with sudo permission.

How to use usermod to set the main group and additional groups in LINUX?

8. But it still doesn’t work here because you have to exit and reconnect.

How to use usermod to set the main group and additional groups in LINUX?

How to use usermod to set the main group and additional groups in LINUX?

How to use usermod to set the main group and additional groups in LINUX?

9. At this time, the permissions have been successfully added.

How to use usermod to set the main group and additional groups in LINUX?

10, and

-g is used to change the main group.

How to use usermod to set the main group and additional groups in LINUX?

The above is the detailed content of How to use usermod to set the main group and additional groups in LINUX?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete