adding support for groups for live user
This commit is contained in:
@@ -26,6 +26,7 @@ user = yes
|
||||
[user]
|
||||
username = ${bdisk:uxname}
|
||||
name = Default user
|
||||
groups = ${bdisk:uxname},admin
|
||||
password =
|
||||
|
||||
[source_x86_64]
|
||||
|
||||
@@ -26,6 +26,7 @@ user = yes
|
||||
[user]
|
||||
username = ${bdisk:uxname}
|
||||
name = Default user
|
||||
groups = ${bdisk:uxname},admin
|
||||
password =
|
||||
|
||||
[source_x86_64]
|
||||
|
||||
@@ -141,7 +141,12 @@ then
|
||||
fi
|
||||
# Add the regular user
|
||||
useradd -m -s /bin/bash -c "${USERCOMMENT}" ${REGUSR}
|
||||
usermod -aG users,games,video,audio ${REGUSR}
|
||||
usermod -aG users,games,video,audio ${REGUSR} # TODO: remove this in lieu of $REGUSR_GRPS? these are all kind of required, though, for regular users anyways
|
||||
for g in $(echo ${REGUSR_GRPS} | sed 's/,[[:space:]]*/ /g');
|
||||
do
|
||||
getent group ${g} > /dev/null 2>&1 || groupadd ${g}
|
||||
usermod -aG ${g} ${REGUSR}
|
||||
done
|
||||
passwd -d ${REGUSR}
|
||||
# Add them to sudoers
|
||||
mkdir -p /etc/sudoers.d
|
||||
|
||||
@@ -4,6 +4,7 @@ export PNAME='{{ bdisk['name'] }}'
|
||||
export DISTPUB='{{ bdisk['dev'] }}'
|
||||
export DISTDESC='{{ bdisk['desc'] }}'
|
||||
export REGUSR='{{ user['username']|lower }}'
|
||||
export REGUSR_GRPS='{{ user['groups'] }}'
|
||||
export USERCOMMENT='{{ user['name'] }}'
|
||||
export REGUSR_PASS='{{ user['password'] }}'
|
||||
export ROOT_PASS='{{ bdisk['root_password'] }}'
|
||||
|
||||
Reference in New Issue
Block a user