[Libosinfo] [PATCH] debian: Configure PAM to allow empty passwords

Lasse Schuirmann lasse.schuirmann at gmail.com
Wed Oct 28 15:29:23 UTC 2015


If this is not configured, GDM will refuse logging in the user on Debian
Jessie.

This patch was verified to work using GNOME Boxes on a Debian 8.2.0 ISO.
---
 .../install-script/debian.org/debian-preseed-desktop.xml.in | 13 +++++++++++--
 data/install-script/debian.org/debian-preseed-jeos.xml.in   |  2 +-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/data/install-script/debian.org/debian-preseed-desktop.xml.in b/data/install-script/debian.org/debian-preseed-desktop.xml.in
index d9ac99d..e384fae 100644
--- a/data/install-script/debian.org/debian-preseed-desktop.xml.in
+++ b/data/install-script/debian.org/debian-preseed-desktop.xml.in
@@ -188,14 +188,23 @@ d-i finish-install/reboot_in_progress note
 <xsl:choose>
   <xsl:when test="config/admin-password = ''">
 # Delete root password
-d-i preseed/late_command string in-target passwd -d root
+d-i preseed/late_command string in-target passwd -d root; in-target sed -i 's/nullok_secure/nullok/' /etc/pam.d/common-auth
   </xsl:when>
 </xsl:choose>
 
 <xsl:choose>
   <xsl:when test="config/user-password = ''">
 # Delete user password
-d-i preseed/late_command string in-target passwd -d <xsl:value-of select="config/user-login"/>
+d-i preseed/late_command string in-target passwd -d <xsl:value-of select="config/user-login"/>; in-target sed -i 's/nullok_secure/nullok/' /etc/pam.d/common-auth
+
+# When we set the late_command the previous one gets overwritten, so if user
+# and admin password is empty we need to specify that explicitly
+    <xsl:choose>
+      <xsl:when test="config/admin-password = ''">
+# Delete root password
+d-i preseed/late_command string in-target passwd -d <xsl:value-of select="config/user-login"/>; in-target passwd -d root && in-target sed -i 's/nullok_secure/nullok/' /etc/pam.d/common-auth
+      </xsl:when>
+    </xsl:choose>
   </xsl:when>
 </xsl:choose>
 
diff --git a/data/install-script/debian.org/debian-preseed-jeos.xml.in b/data/install-script/debian.org/debian-preseed-jeos.xml.in
index 13af8c1..0f0d329 100644
--- a/data/install-script/debian.org/debian-preseed-jeos.xml.in
+++ b/data/install-script/debian.org/debian-preseed-jeos.xml.in
@@ -116,7 +116,7 @@ d-i finish-install/reboot_in_progress note
 <xsl:choose>
   <xsl:when test="config/admin-password = ''">
 # Delete password
-d-i preseed/late_command string in-target passwd -d root
+d-i preseed/late_command string in-target passwd -d root; in-target sed -i 's/nullok_secure/nullok/' /etc/pam.d/common-auth
   </xsl:when>
 </xsl:choose>
 
-- 
2.6.2




More information about the Libosinfo mailing list