fix user setup

By using the 'user' command in Kickstart, systemd-logind.service fails
to start. Following that, providing correct user credentials bars the
user from login. Revert back to the old config.
This commit is contained in:
Pratham Patel 2023-08-11 20:17:07 +05:30
parent 36556227aa
commit f6cbfcdf2c
No known key found for this signature in database
3 changed files with 17 additions and 6 deletions

View File

@ -4,4 +4,3 @@
%include includes/post-install.ksi
%include includes/pre-install.ksi
%include includes/rocky-9-repos.ksi
%include includes/user-setup.ksi

View File

@ -5,6 +5,23 @@
# Setup networking temporarily
[ -f /etc/resolv.conf ] || echo "nameserver 1.1.1.1" > /etc/resolv.conf
# User setup
DEFAULT_USERNAME='rocky'
DEFAULT_PASSWORD='rockylinux'
DEFAULT_GROUPS='wheel'
useradd --comment "Rocky Linux" \
--uid 1000 \
--create-home \
--user-group "${DEFAULT_USERNAME}" \
--groups "${DEFAULT_GROUPS}"
echo -e "${DEFAULT_PASSWORD}\n${DEFAULT_PASSWORD}" | passwd "${DEFAULT_USERNAME}"
passwd -e "${DEFAULT_USERNAME}"
# Lock the root account
passwd -l root
# The script that expands root partition
[ -d /usr/local/bin ] || mkdir --verbose /usr/local/bin
curl 'https://git.resf.org/thefossguy/rocky-linux-generic-images/raw/branch/r9/scripts/expand-rootfs.sh' --output /usr/local/bin/expand-rootfs.sh

View File

@ -1,5 +0,0 @@
# Create user 'rocky' with password 'rockylinux' and added in group 'wheel'
user --name=rocky --groups=wheel --homedir=/home/rocky --plaintext --password=rockylinux --uid=1000 --gid=1000
# Lock the root user account
user --name=root --lock