From 4c655e82b219f7bdb56ed16a53743407a85231c2 Mon Sep 17 00:00:00 2001 From: Gregory Kurtzer Date: Sat, 19 Dec 2020 21:06:28 -0800 Subject: [PATCH] Fix PAM for broken_shadow so users can log in based on ssh keys only --- overlays/system/default/init.ww | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/overlays/system/default/init.ww b/overlays/system/default/init.ww index 16cbbd6d..5832228b 100755 --- a/overlays/system/default/init.ww +++ b/overlays/system/default/init.ww @@ -25,6 +25,21 @@ if false; then fi +# This will eventually be optional +if true; then + if [ -f "/etc/pam.d/system-auth" ]; then + sed -i -e '/^account.*pam_unix\.so\s*$/s/\s*$/\ broken_shadow/' /etc/pam.d/system-auth + fi + + if [ -f "/etc/pam.d/password-auth" ]; then + sed -i -e '/^account.*pam_unix\.so\s*$/s/\s*$/\ broken_shadow/' /etc/pam.d/password-auth + fi + + if [ -f "/etc/pam.d/common-account" ]; then + sed -i -e '/^account.*pam_unix\.so\s*$/s/\s*$/\ broken_shadow/' /etc/pam.d/common-account + fi +fi + mount -t proc none /proc mount -t sysfs none /sys mount -t devtmpfs devtmpfs /dev @@ -35,6 +50,7 @@ nohup /warewulf/bin/wwclient >/var/log/wwclient.log 2>&1 /var/log/ipmi.log 2>&1