How can I change the Keyboard Layout on login screen?
26,212
Press Ctrl+Alt+F1 to switch console mode. Type your username and press Enter and also now type your password.
Next type
sudo dpkg-reconfigure keyboard-configuration
and hit Enter type your password again and follow screen instruction.
As usual, it will prompt you for the model of keyboard (what the keyboard is), and then for the keyboard layout (what the keys should do)
To apply new settings, restarting the keyboard-setup service with this
sudo service keyboard-setup restart
Related videos on Youtube
Author by
Admin
Updated on September 18, 2022Comments
-
Admin over 1 year
I changed my Keyboard Layout from Swedish to English, but now my password doesn’t work and I can’t login. I need a way to change the keyboard layout at the login screen without having access to the keyboard or a way to enter the password using characters not available on the keyboard itself.
-
Anto about 7 yearsPossible duplicate of How do I change the login manager's keyboard layout?
-
-
Cedric Martens over 6 yearsBut how am I supposed to type
sudo service keyboard-setup restart
if I can't login because of the layout -
Colonel Panic about 5 yearsWhy switch to console mode? Can't I just open a terminal?
-
Akif over 4 years
Ctrl + Alt + F3
for switching to console mode in Ubuntu 18.04 askubuntu.com/a/1053220/726213 -
wgj about 4 yearsThis worked specifically when most x.org settings (
setxkbmap
andlocalectl ...
would not persist after restarts with Kali. Thank you very much. -
medina about 4 yearsI've ben looking for this solution for a long time. Really appreciate your answer. Many thanks!
-
ElRudi over 3 yearsI know this thread is old, but maybe the people are still around ;) Is there a way to add a second keyboard? This solution replaces the existing layout
-
user149408 about 3 yearsTo answer some questions from the comments: Depending on how/where OP set the layout, this change only affects the desktop session, but not the tty consoles (where the login screen gets its layout from depends on the flavor of Ubuntu). Hence we need
Ctrl + Alt + F3
to switch to a tty console, which (hopefully) still has the Swedish layout so OP can enter their password. Of course one could run these commands from a terminal, but only after you manage to log into a desktop session. -
user149408 about 3 yearsWouldn’t it be possible to run
sudo dpkg-reconfigure keyboard-configuration
in recovery mode and revert to a keyboard layout that has all the characters needed for recovery mode? -
Admin almost 2 yearsFor me it was a french "afnor" and I switched to "azerty". It was a shot in the dark however, I wonder where one could find a list of all available variants
-
Admin almost 2 yearsyou can try
localectl list-x11-keymap-layouts
orlocalectl list-x11-keymap-variants
-
Admin almost 2 yearsThat's excatly what I meant ! Thanks !