Package: libpam-modules
Version: 1.5.2-6
Severity: minor
Tags: patch

Dear developer,

Since Bookworm, `adduser` by default creates system users without a home directory, and the manual page states:

"If no home directory is specified, the default home directory for a new system user is /nonexistent. This directory should never exist on any Debian system, and adduser will never create it automatically."

Unfortunately, pam_mkhomedir.so does create such a home directory if a system user opens a session (in my case, a system user existing solely to create SSH tunnels from a system to another).

A simple workaround is to jump over the pam_mkhomedir.so call if the home directory matches "/nonexistent".

Here is a simple patch to accomplish this.

The patch suppresses wrongful behavior and seems quite harmless to me, so a proposed-update to Trixie would be appreciated.

Regards,

--
Raphaël Halimi

From 96d9df7a86c646052961e936ffa10851309d8ed0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Halimi?= <[email protected]>
Date: Sun, 7 Jun 2026 19:14:20 +0200
Subject: [PATCH] d/pam-configs/mkhomedir: do not create /nonexistent

---
 debian/pam-configs/mkhomedir | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/pam-configs/mkhomedir b/debian/pam-configs/mkhomedir
index 9c27980a..55c6b1d3 100644
--- a/debian/pam-configs/mkhomedir
+++ b/debian/pam-configs/mkhomedir
@@ -4,4 +4,5 @@ Priority: 0
 Session-Type: Additional
 Session-Interactive-Only: yes
 Session:
+	[success=1 default=ignore]	pam_succeed_if.so quiet home = /nonexistent
 	optional			pam_mkhomedir.so
-- 
2.53.0

Reply via email to