diff --git a/modules/ipa/client.nix b/modules/ipa/client.nix index 818400c..3880be2 100644 --- a/modules/ipa/client.nix +++ b/modules/ipa/client.nix @@ -60,6 +60,15 @@ lib.mkIf enabled { pam.services = { sshd.makeHomeDir = true; lightdm.makeHomeDir = true; + + # pam_unix returns PAM_AUTHINFO_UNAVAIL without prompting when the local + # stub has "!" in shadow (account locked), so PAM_AUTHTOK is never set + # and pam_sss's use_first_pass fails with "No authentication token". + # Changing to try_first_pass makes pam_sss prompt independently when no + # prior module has set the token, restoring IPA password login via + # LightDM and su. + login.rules.auth.sss.settings = lib.mkForce { try_first_pass = true; }; + su.rules.auth.sss.settings = lib.mkForce { try_first_pass = true; }; }; # HM with useUserPackages = true (flake.nix) sets users.users.${ipaUser}.packages, @@ -170,6 +179,13 @@ lib.mkIf enabled { group = "users"; extraGroups = [ "wheel" ]; createHome = false; + # "!" is not a password hash — it is the standard "account locked" marker. + # It cannot authenticate anyone locally. It exists solely so NixOS generates + # a shadow entry for this stub user; without one pam_unix returns + # PAM_AUTHINFO_UNAVAIL before prompting, which means PAM_AUTHTOK is never + # set and the subsequent pam_sss use_first_pass call has nothing to work + # with — blocking LightDM and su logins even when IPA/SSSD auth succeeds. + hashedPassword = "!"; }; # Home Manager config for the IPA primary user, applied on every enrolled