linux下一个用户如何分配给多个用户组?求命令,谢了。
比如下中的xSwap:video:x:33:xSwapwheel:x:10:xSwapxgate:!:1000:xSwapmysql:!:108:xSwap...
比如下中的xSwap:
video:x:33:xSwap
wheel:x:10:xSwap
xgate:!:1000:xSwap
mysql:!:108:xSwap 展开
video:x:33:xSwap
wheel:x:10:xSwap
xgate:!:1000:xSwap
mysql:!:108:xSwap 展开
展开全部
你可以使用usermod -G group1 group2 group3 group4
参见man usermod
-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
A list of supplementary groups which the user is also a member of. Each group is
separated from the next by a comma, with no intervening whitespace. The groups are
subject to the same restrictions as the group given with the -g option.
If the user is currently a member of a group which is not listed, the user will be
removed from the group. This behaviour can be changed via the -a option, which
appends the user to the current supplementary group list.
参见man usermod
-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
A list of supplementary groups which the user is also a member of. Each group is
separated from the next by a comma, with no intervening whitespace. The groups are
subject to the same restrictions as the group given with the -g option.
If the user is currently a member of a group which is not listed, the user will be
removed from the group. This behaviour can be changed via the -a option, which
appends the user to the current supplementary group list.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询