Bug 471020

Summary: kscreenlocker fails to unlock a session when a systemd dynamic user is running of the same user
Product: [Plasma] plasmashell Reporter: ugjka <ugis>
Component: Screen lockingAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: 6.2.4   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description ugjka 2023-06-14 12:01:05 UTC
SUMMARY
***
Kscreenlocker fails to unlock a session when a Systemd dynamic user is running of the same user you are trying to unlock
***


STEPS TO REPRODUCE
1. Start a systemd service that pulls in DynamicUser=yes setting and the service runs as your user
2. check getent passwd to see if the dynamic user is indeed running 

[ugjka@ugjka ~]$ getent passwd 
--- snip ---
ugjka:x:1000:1000:ugjka:/home/ugjka:/bin/bash
ugjka:x:1000:1000:Dynamic User:/:/usr/bin/nologin

3. Run the locker (/usr/lib64/kscreenlocker_greet --testing) and try unlocking the session
4. Unlock fails and leaves an error in journal:

Jun 14 14:35:09 ugjka kscreenlocker_greet[8963]: pam_unix(kde:auth): authentication failure; logname=ugjka uid=1000 euid=1000 tty= ruser= rhost=  user=ugjka

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.9
Kernel Version: 6.3.7-zen1-1-zen (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
About dynamic users: https://0pointer.net/blog/dynamic-users-with-systemd.html

WORKAROUND 
Set DynamicUser=no to systemd services that use it and that run as your user
Comment 1 Nate Graham 2025-05-29 16:31:55 UTC
You may be the first person to use a setup like this! Can you describe a bit what it's used for, why one would want it, what the benefits are, how we would support it, etc?
Comment 2 ugjka 2025-05-29 17:15:38 UTC
Things seems to have changed, I can no longer replicate the issue. You can close this
Comment 3 Nate Graham 2025-05-29 17:51:57 UTC
Great, thanks for letting us know.