deflogin: Added SPECIAL_USER
Variable SPECIAL_USER must have the following format: user:group:uid:gid:homedir:shell Example: @$(call set,SPEC_USER,user:user:500:500:/home/user:/bin/bash)
This commit is contained in:
parent
1d6f12bf59
commit
c00f508b84
@ -58,7 +58,8 @@ vm/regular-jeos-systemd: vm/systemd-net \
|
||||
mixin/regular-vm-jeos mixin/vm-archdep
|
||||
@$(call add,THE_PACKAGES,glibc-locales)
|
||||
|
||||
vm/regular-jeos-sysv: vm/net mixin/regular-vm-jeos mixin/vm-archdep +power; @:
|
||||
vm/regular-jeos-sysv: vm/net mixin/regular-vm-jeos mixin/vm-archdep +power
|
||||
@$(call set,SPEC_USER,officer:officer:64:64:/bin/bash)
|
||||
|
||||
vm/regular-builder: vm/regular-jeos-sysv mixin/regular-builder
|
||||
@$(call set,VM_SIZE,10737418240)
|
||||
|
@ -62,6 +62,7 @@ distro/.regular-jeos-base: distro/.regular-bare \
|
||||
@$(call add,THE_BRANDING,alterator) # just to be cleaned up later on
|
||||
@$(call add,THE_PACKAGES,apt basesystem dhcpcd vim-console su agetty)
|
||||
@$(call add,THE_LISTS,openssh)
|
||||
@$(call set,SPEC_USER,officer:officer:64:64:/bin/bash)
|
||||
|
||||
# ...and for somewhat bare distros
|
||||
distro/.regular-jeos: distro/.regular-jeos-base use/stage2/kms \
|
||||
|
@ -6,6 +6,7 @@ use/deflogin:
|
||||
@$(call xport,ROOTPW)
|
||||
@$(call xport,USERS)
|
||||
@$(call xport,GROUPS)
|
||||
@$(call xport,SPEC_USER)
|
||||
|
||||
# some presets
|
||||
# USERS variable chunk format is "login:passwd:admin:sudo"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh -x
|
||||
# add regular user(s) assigning passwords and attributes of power
|
||||
|
||||
# NB: care that the utilities exist; shadow-utils is warranted
|
||||
@ -34,3 +34,13 @@ set_sudo() {
|
||||
[ -z "$admin" ] || set_admin "$login"
|
||||
[ -z "$sudo" ] || set_sudo "$login"
|
||||
done
|
||||
|
||||
# create special user
|
||||
[ -z "$GLOBAL_SPEC_USER" ] ||
|
||||
echo "$GLOBAL_SPEC_USER" \
|
||||
| tr ' ' '\n' \
|
||||
| while IFS=':' read login group uid gid homedir shell; do
|
||||
groupadd -g $gid $group >/dev/null 2>&1 || :
|
||||
useradd -g $gid -u $uid -d $homedir -s $shell $login >/dev/null 2>&1 || :
|
||||
usermod -G $group $login || :
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user