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.
7 Answers
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-configurationand 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
- 36,350
This works for me: Change de variable XKBVARIANT = “us”, on file /etc/default/keyboard to the name of layout you want and reboot.
This is an old post, but recently I have faced with the same issue and the solution above did not help.
During the Linux Mint installation, I accidentally selected the wrong keyboard layout. Later I fixed it by removing the old one and adding the proper keyboard, but unfortunately, this had no impact on the login screen.
Solution:
- login and show your current, working layout configuration with
setxkbmap -print -verbose 10 - check the layout that is used on the login screen:
cat /etc/default/keyboard - set up properly the login screen keyboard layout with
sudo dpkg-reconfigure keyboard-configuration
That was the only solution that worked for me. I hope that it helps you as well.
- 997
For anyone who's been facing the same problem and nothing worked here's an idea boot from the recovery mode then scroll down to root then write the following command to reset your password "passwd yourUserName" then enter your new password for that username hope this helps :)
- 101
Use tty3 using Ctrl+Alt+F3
sudo nano /etc/default/keyboardto look like this:# KEYBOARD CONFIGURATION FILEConsult the keyboard(5) manual page.
XKBMODEL="macbook78"<br> XKBLAYOUT="de"<br> XKBVARIANT="basic"<br> XKBOPTIONS=""<br>
BACKSPACE="guess"
sudo setupconreboot
After that it changed my layout.
- 5,339
- 11
In GNOME 42, localectl told me VC Keymap: n/a.
Running sudo localectl set-x11-keymap dk set the login screen layout to Danish.
I have no input source selection available under Region & Languages > Login Screen.
See further this GNOME help page
- 8,655
I just had the same problem on Ubuntu 22. On the login screen click on the accessibility options and activate the screen keyboard, then you should be able to get your special character and login.
Then once logged in, you should be able to do the proper configuration described by the other answers.