Handle sysmaint account password when autologin is disabled#3
Open
assisted-by-ai wants to merge 2 commits intoKicksecure:masterfrom
Open
Handle sysmaint account password when autologin is disabled#3assisted-by-ai wants to merge 2 commits intoKicksecure:masterfrom
assisted-by-ai wants to merge 2 commits intoKicksecure:masterfrom
Conversation
When autologin is disabled for the sysmaint account, the display
manager greeter requires manual authentication. However, the sysmaint
account is created with an empty password, which PAM rejects (pam_unix
does not allow empty passwords without nullok). This causes immediate
login failure before the password prompt even appears.
Fix by detecting when autologin is off and the sysmaint account has no
password during sysmaint boot, then setting a temporary password
('changeme') that is cleared on shutdown.
Also fix a bug in X11_Xsession.d_15_sysmaint_no_desktop where the
session guard checked a hardcoded string instead of the $DESKTOP_SESSION
variable, making the guard a no-op.
https://claude.ai/code/session_013aeZmbWvCMJxAPDcHYiBqS
Contributor
|
I don't think we should integrate this patch. Kicksecure intentionally allows users to log into passwordless accounts, the assumption about empty password rejection is mistaken. (Even if we did want to integrate this, we would need to make some changes, because it currently unconditionally deletes the temporary password it set up upon shutdown, which would make it very difficult for the user to set a real password since any real password they set would get deleted on shutdown.) |
Upstream chose $XDG_CURRENT_DESKTOP over $DESKTOP_SESSION for the session guard check. Align with that choice since XDG_CURRENT_DESKTOP is the standard way to identify the current desktop and is set directly from the DesktopNames= field in the session .desktop files. https://claude.ai/code/session_013aeZmbWvCMJxAPDcHYiBqS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds logic to manage the sysmaint account password when autologin is disabled. When autologin is turned off, the display manager greeter requires manual authentication. If the sysmaint account has an empty password, PAM will reject login attempts on security-hardened systems. This change detects that condition and sets a temporary password to allow login.
Key Changes
Password detection and temporary setup: Added
ensure_sysmaint_has_password()function insysmaint-bootthat:Password restoration on shutdown: Added
restore_sysmaint_empty_password()function that:Cleanup script integration: Updated
sysmaint-boot-cleanupto also restore the empty password state during shutdown, ensuring idempotent behaviorBug fix: Corrected
X11_Xsession.d_15_sysmaint_no_desktopto use${DESKTOP_SESSION:-}instead of hardcoded string literal, allowing proper desktop session detectionImplementation Details
passwd -Sto detect empty password status (NP flag)/run/user-sysmaint-split/temp-password-sethttps://claude.ai/code/session_013aeZmbWvCMJxAPDcHYiBqS