sbc-images/includes/post/user-setup.ksi

29 lines
697 B
Plaintext

%post
set -x
# The official kickstart docs has a 'user' command, but using it somehow
# causes 'systemd-logind.service' to fail during boot and you are essentially
# locked out even when you enter the correct credentials
# User setup
USER_COMMENT='Pratham Patel'
USER_NAME='pratham'
USER_PASSWORD='asdf'
USER_GROUPS='mock,wheel'
# The 'useradd' binary can't be found in $PATH (idk why), so
# execute it using its absolute path
/sbin/useradd \
--uid 1000 \
--create-home \
--comment "${USER_COMMENT}" \
--user-group "${USER_NAME}" \
--groups "${USER_GROUPS}"
echo -e "${USER_PASSWORD}\n${USER_PASSWORD}" | passwd "${USER_NAME}"
# Lock the root account
passwd -l root
%end