How do you create a user group in CentOS 7?

To create a user group on CentOS 7, you can use the following command:

sudo groupadd [group_name]

A new user group named [group_name] will be created in the system. To view the newly created user group, you can use the following command:

cat /etc/group | grep [group_name]

You can also use the following command to add a new supplementary group to an existing user:

sudo usermod -a -G [group_name] [username]

Please remember, when performing any user group operations, make sure you have root privileges or run the command as a sudo user.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds