From 3dde9f6316f2ed7d90e60a117fa1f60f8986b2f7 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 2 Nov 2011 14:48:13 -0400 Subject: [PATCH] fix postinstall user creation/modification (fixes #750907) We were appending to /etc/shadow when previous versions of lorax overwrote it, so we ended up with two conflicting entries for "root". Instead: - keep existing /etc/shadow and /etc/passwd contents - add new entries for "install" user - remove password from existing "root" entry in /etc/shadow Also, we don't need to create the 'sshd' user, because the openssh-server %post script does that for us. --- share/runtime-postinstall.tmpl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/share/runtime-postinstall.tmpl b/share/runtime-postinstall.tmpl index 5feab577..2acfa217 100644 --- a/share/runtime-postinstall.tmpl +++ b/share/runtime-postinstall.tmpl @@ -67,11 +67,12 @@ install ${configdir}/sshd_config.anaconda etc/ssh install ${configdir}/pam.sshd etc/pam.d/sshd install ${configdir}/pam.sshd etc/pam.d/login install ${configdir}/pam.sshd etc/pam.d/remote -append etc/passwd "sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin" + +## set up "install" user account append etc/passwd "install:x:0:0:root:/root:/sbin/loader" -append etc/shadow "root::14438:0:99999:7:::" append etc/shadow "install::14438:0:99999:7:::" -chmod etc/shadow 400 +## remove root password +replace "root:*:" "root::" etc/shadow ## s390-specific setup %if basearch in ("s390", "s390x"):