“localectl” is a command allowing you to quickly verify the keyboard mappings settings on a Linux system and also modify the current configuration. There are times when password or known keyboard combinations do not work as expected. The first step for troubleshooting is to check what keyboard mappings and layout settings are in use on the local system.
The sample command usage is shown below:
test@kali:~$ localectl status
System Locale: LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
VC Keymap: n/a
X11 Layout: gb
X11 Model: pc105
The output above shows that the UK (en-GB) keyboard mapping is in use. In addition, it says that the standard universal keyboard is connected and in use.
Sometimes you may wonder why certain passwords or commands do not work as intended, even though you are convinced that they are correctly entered and executed. In that case, check the keyboard mappings first to understand whether it could be the root cause of the problem.
How is that related to the cyber security?
You may log into or gain access to remote system to perform a routine security focused review or perform post exploitation reconnaissance. As you may not be immediately aware of what settings are being enforced, you should check them to avoid having to spend time on unnecessary troubleshooting. Even though, the language in use may be English it does not mean that the same passwords will work for both the UK and US keyboard layouts. That is because each keyboard mapping or layout has subtle differences. If you forget about them, you may end up going around the circles and wondering why passwords do not work.
To learn more about the command, please read the man page.
More information about other interesting commands can be found here.