我正在为朋友创建自定义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
这将禁用此行为,因此您可以随时对其进行切换on/off
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句