From f6cbfcdf2c604c156e089135429d95daf1e31ab3 Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Fri, 11 Aug 2023 20:17:07 +0530 Subject: [PATCH] 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. --- Rocky-9-aarch64-minimal.ks | 1 - includes/post-install.ksi | 17 +++++++++++++++++ includes/user-setup.ksi | 5 ----- 3 files changed, 17 insertions(+), 6 deletions(-) delete mode 100644 includes/user-setup.ksi diff --git a/Rocky-9-aarch64-minimal.ks b/Rocky-9-aarch64-minimal.ks index 6c4e61d..e7d886f 100644 --- a/Rocky-9-aarch64-minimal.ks +++ b/Rocky-9-aarch64-minimal.ks @@ -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 diff --git a/includes/post-install.ksi b/includes/post-install.ksi index f61cb7e..bc0060d 100644 --- a/includes/post-install.ksi +++ b/includes/post-install.ksi @@ -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 diff --git a/includes/user-setup.ksi b/includes/user-setup.ksi deleted file mode 100644 index c15e089..0000000 --- a/includes/user-setup.ksi +++ /dev/null @@ -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