Today I’ve accidentally locked myself with Linux screensaver.
How this happened?
I use English letters for my password, but when I’ve stepped back from my Linux workstation my keyboard group was with group different than English.
As result when I come back and tried to unlock myself I couldn’t enter the correct password.
1. First and simplest solution will be to kill X with Crtl+Alt+Backspace
2. Reboot the PC – Alt+Ctrl+Del
3. Try to fix it
Because I’ve had open and unsaved documents first 2 options will result loss of my work I’ve decided to go with third one.
How I did it:
A requirement is to have another PC and ssh access to main one.
1. Login via ssh to locked PC.
2. Start vnc server under your account
Note you will need vnc server installed. How to do it is out of the scope – consult your documentation.
3. Open firewall ports required for VNC or simply shutdown firewall
4. On other PC start VNC client and connect to locked one
5. Start keyboard configuration
6. Remove all other layouts except English
7. Now you can return to locked PC and unlock it.
NOTE: This procedure was tested on LAN and CentOS 5.