次要组是用户创建后添加的组。主要组是在用户创建过程中创建的。为了权限,它们之间没有区别。
本快速教程可帮助您通过命令行将现有用户添加到 Linux 中的辅助组。
Example
Use the usermod command-line tool to assign a user to a secondary group. Here you can define multiple group names separate them by a comma.
The following command will add jack to sudo group.
usermod -a -G sudo jack
To make sure, check the entry in /etc/group
文件。
cat /etc/group | grep "sudo"
Remove User from Secondary Group
If in case, you have accidentally added a user to a different group or you want to remove another user from the group. The following command will remove user "jack" from the group "sudo".
sudo gpasswd -d jack sudo
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)