Unlock user session (lock screen) from console as root with Plasma Wayland

There are a few rare occurrences when the KDE lock screen will no longer show up and I only see a black screen, leaving me unable to unlock my session… however the system isn’t actually frozen, I can still use Control + Alt + F3 to switch to a different runlevel and login as root then Control + Alt + F1 back to the normal screen. In the X11 days there used to be a console command I could type to unlock the session, something sysctl based if I’m not mistaken; Is there a root command I can use to crack open the user lock screen in Plasma Wayland session?

Your answer might be in this link here.
Perhaps that is what you remembered.

1 Like

Point of information.

That is a TTY. Which is on a different display “seat”.
A runlevel is something you boot into.
Like you normally boot into runlevel 5.
Runlevel 3 would not start your graphics.
Runlevel 2 would be the same but also without networking.
And so on.

This should not be happening.

And for what its worth - the plasma lockscreen and SDDM that you log in with are 2 different things.

In any case I would probably want to investigate why this error is occurring in the first place.


Thanks! Next time it happens I will give that a go.

On why and when it occurs, there’s a small chance that when my computer wakes up from standby it does so to a black screen rather than the lock screen I type my password into, it’s happened a few times in the past months. The monitor is powered on and I see and can move the mouse cursor, just that everything behind it is a black background. Currently I switch to another TTY login as root and use the reboot command to do a clean restart, this way I can hopefully avoid having to restart.

Oh: When I switch to this TTY the console is slowly being covered in waves of error messages, I actually have to type stuff without even seeing what I’m writing as it prints lines over it. Next time I’ll take a photo, it’s actually quite silly of me that I haven’t and forgot what they say.


man loginctl


Session Commands
           List current sessions.

       session-status [ID...]
           Show terse runtime status information about one or more sessions, followed by the most recent log data from the journal. Takes one or more session identifiers as parameters. If no session
           identifiers are passed, the status of the caller's session is shown. This function is intended to generate human-readable output. If you are looking for computer-parsable output, use show-session

           Added in version 233.

       show-session [ID...]
           Show properties of one or more sessions or the manager itself. If no argument is specified, properties of the manager will be shown. If a session ID is specified, properties of the session are
           shown. Specially, if the given ID is "self", the session to which the loginctl process belongs is used. If "auto", the current session is used as with "self" if exists, and falls back to the
           current user's graphical session. By default, empty properties are suppressed. Use --all to show those too. To select specific properties to show, use --property=. This command is intended to be
           used whenever computer-parsable output is required. Use session-status if you are looking for formatted human-readable output.

           Added in version 233.

       activate [ID]
           Activate a session. This brings a session into the foreground if another session is currently in the foreground on the respective seat. Takes a session identifier as argument. If no argument is
           specified, the session of the caller is put into foreground.

           Added in version 219.

       lock-session [ID...], unlock-session [ID...]
           Activates/deactivates the screen lock on one or more sessions, if the session supports it. Takes one or more session identifiers as arguments. If no argument is specified, the session of the
           caller is locked/unlocked.

           Added in version 233.

       lock-sessions, unlock-sessions
           Activates/deactivates the screen lock on all current sessions supporting it.

           Added in version 188.

       terminate-session ID...
           Terminates a session. This kills all processes of the session and deallocates all resources attached to the session. If the argument is specified as empty string the session invoking the command
           is terminated.

           Added in version 233.

       kill-session ID...
           Send a signal to one or more processes of the session. Use --kill-whom= to select which process to kill. Use --signal= to select the signal to send. If the argument is specified as empty string
           the signal is sent to the session invoking the command.

           Added in version 233.

1 Like

No need to do a full reboot.

Even if the unlocking the session doesn’t work,
what will work is to restart the display manager.

systemctl restart sddm.service

should be the command to do it on a KDE Plasma installation

You will lose your session - but avoid a reboot.


Thanks! I tested and can confirm loginctl list-sessions and loginctl unlock-session 2 work perfectly with Plasma Wayland! I’ll note down systemctl restart sddm.service too in case I ever need that, just realized that if SDDM crashes locking the screen again would likely take me back to the black screen which I’d need to fix.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.