30 lines
719 B
Plaintext
30 lines
719 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='Rocky Linux'
|
|
USER_NAME='rocky'
|
|
USER_PASSWORD='rockylinux'
|
|
USER_GROUPS='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}"
|
|
passwd -e "${USER_NAME}"
|
|
|
|
# Lock the root account
|
|
passwd -l root
|
|
|
|
%end
|