如何在Linux中创建没有默认组属性的用户?

如何在Linux中创建没有默认组属性的用户?

我知道,如何用属性创建

adduser -n username

组,我们在 中找到/etc/default/useradd。但是在 中login.defs,我们可以添加一些东西。

答案1

如果您想要的是默认adduser user1创建user1并将它们放入组中,您应该更改这些行101/etc/adduser.conf:

# The USERGROUPS variable can be either "yes" or "no".  If "yes" each
# created user will be given their own group to use as a default.  If
# "no", each created user will be placed in the group whose gid is
# USERS_GID (see below).
USERGROUPS=yes

# If USERGROUPS is "no", then USERS_GID should be the GID of the group
# `users' (or the equivalent group) on your system.
USERS_GID=100

所以在你的情况下你会:

USERGROUPS=no
USERS_GID=101

相关内容