当我尝试在轮组中添加用户时:
usermod -g wheel gex
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
usermod: group 'wheel' does not exist
Run Code Online (Sandbox Code Playgroud)
小智 7
错误信息很明显:'wheel' 组不存在。它通常是在 BSD 系统上使用的组名,而不是在 Linux 上。在 Ubuntu 上,它默认不存在,需要创建:addgroup wheel
. 但是,最好编辑您的问题并告诉我们您想要达到的目标。
正如 Teun Vink 所说,该wheel
组在 Ubuntu 中并不存在。这可能有助于解决 Ubuntu 方式的问题:Wheel Group: Updated。
此外(和/或对于具有wheel
组的 Linux 发行版),您尝试执行的操作的正确语法是:
usermod -a -G wheel gex
Run Code Online (Sandbox Code Playgroud)
注意大写“G”。
使用该-a
选项会附加新组,这样用户就不会丢失以前的组。
使用小写-g
选项将用户置于该组中作为他/她的主要组。
使用大写-G
选项将用户添加到补充组:
man usermod
。