我正在为一个朋友创建一个定制的ISO文件。
我如何将所有用户和未来的新用户添加到音频(或任何其他)组中?
如果我想添加单个用户,我会运行以下命令:
每次创建新用户账户时,是否有自动执行的方法?
我如何将所有用户和未来的新用户添加到音频(或任何其他)组中?
如果我想添加单个用户,我会运行以下命令:
sudo adduser $USER audio
每次创建新用户账户时,是否有自动执行的方法?
/etc/adduser.conf
文件来实现。编辑该文件:sudo nano /etc/adduser.conf
# Set this if you want the --add_extra_groups option to adduser to add
# new users to other groups.
# This is the list of groups that new non-system users will be added to
# Default:
#EXTRA_GROUPS="dialout cdrom floppy audio video plugdev users"
# If ADD_EXTRA_GROUPS is set to something non-zero, the EXTRA_GROUPS
# option above will be default behavior for adding new, non-system users
#ADD_EXTRA_GROUPS=1
# Set this if you want the --add_extra_groups option to adduser to add
# new users to other groups.
# This is the list of groups that new non-system users will be added to
# Default:
EXTRA_GROUPS="audio"
# If ADD_EXTRA_GROUPS is set to something non-zero, the EXTRA_GROUPS
# option above will be default behavior for adding new, non-system users
ADD_EXTRA_GROUPS=1
adduser
命令时,用户也将被添加到音频组中。请注意,该组必须存在。因此,如果该组不存在,请先创建该组,然后将其添加到/etc/adduser.conf
文件中。ADD_EXTRA_GROUPS=1
到
ADD_EXTRA_GROUPS=0
adduser
添加用户,那么默认的/etc/adduser.conf
不是已经这样做了吗?(通过EXTRA_GROUPS
和ADD_EXTRA_GROUPS
条目) - steeldriver