how to login from bash to bypass the graphic lock screen

Hello everyone,

I am using a dual monitors with Tumbleweed. Sometimes the password input form is not accessible after I close the monitors.

I once found a post said one could use Ctrl+Alt+F1 to switch to bash and run some commands then use Ctrl+Alt+F7 to switch back, and the desktop would be unlocked. But I could not find that post any more.

Does anyone know that command combination? In case it matters, I am using KDE Plasma5.

Thanks in advance!

X provides you with “logical screens”. Your GUI session normaly runs at logical screen 7. When you use a second GUI login (via the menus) it is at logical screen 8 (etc.). Logical screen 1 is the system console (where you can see the texts output during boot) and there will be a character/TTY login prompt there. On logical screen 2 - 6 there will also be character/TTY login prompts.

And yes, youu can scwitch between the several logical screens with Ctrl-Alt-Fn where n is the nuimber of the screen you want to go to. Thus Cttrl-Alt-F1 brings you the “real system console” and Ctrl-Alt-F7 brings you back to the GUI session (or login if there is no running session).

Hi Henk,

Thank you for this clarifying.

Do you mean that I cannot unlock the graphic screen at Ctrl+Alt+F7 by any commands from the TTY on Ctrl+Alt+Fn (n=1,…,6)?

I really remember that I used such commands once. But I could not find it now.

Hi
You can still use the init 3 and init 5 commands, but since we are using systemd these days;

For runlevel 3 (no DE) one of;


init 3

systemctl isolate multi-user.target

systemctl isolate runlevel3.target

For runlevel 5 (DE) one of


init 5

systemctl isolate graphical.target

systemctl isolate runlevel5.target

You can, but I don’t remember the command.

I recently had that happen in Plasma 5. The screen locked. There was a message on the screen telling me what magic incantation I had to use from a console login to unlock the screen. I guess you can try that, and see the message.

My normal instinct, if that happened, would be to use CTRL-ALT-BACKSPACE (twice) to crash the X session. However, I tried the command that the screen message indicated. And it worked to unlock the session. I then configured Plasma 5 to never lock the screen (so that this won’t happen again).

Recovering a vague memory, and checking the man page, it looks as if the command to unlock the session was:


# loginctl unlock-sessions

Hi,

Thank you everyone for your kind helps and I am truly sorry for the delay of replying.

Dear nrickert,

This is exactly what I am looking for. I searched for almost half a month to try to find this. You make me jealous!

And the CTRL-ALT-BACKSPACE (twice) trick is not good because it will make me lose all the states of the running apps. And it’s very similar to the one post by Malcolm below.

Dear Malcolm,

I have used the command like init 3 or something like that, but it will make me lost all the apps currently running. It is a bit frustrating.

Thanks to everyone again! This problem is solved. Many thanks!

Hi,

Thank you everyone for your kind helps and I am truly sorry for the delay of replying.

Dear nrickert,

This is exactly what I am looking for. I searched for almost half a month to try to find this. You make me jealous! And, I never had the chance to see the message when I am locked out.

And the CTRL-ALT-BACKSPACE (twice) trick is not good because it will make me lose all the states of the running apps. And it’s very similar to the one post by Malcolm below.

Dear Malcolm,

I have used the command like init 3 or something like that, but it will make me lost all the apps currently running. It is a bit frustrating.

Thanks to everyone again! This problem is solved. Many thanks!