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.
Press Ctrl+Alt+F1 to switch console mode. Type your username and press Enter and also now type your password.
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
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 :)