I am trying to figure out how to fix an issue where two different users on the same raspbian bookworm RPi 5 device have two different keyboard mappings in the terminal and default text editor. The UI login screen works fine.
Does anyone have any suggestions to resolve the problem?
The system works fine for the initial root user when trying to type in the terminal or the text editor. However for the second user on the system, the keyboard mapping in the terminal is different and this breaks scripts and sudo fail. For example, I can't sudo anything because the wrong characters are entered into the password input or use the | character.
Situation:
1) After the initial OS installation, the root user had a generic 105 keyboard configuration which resulted in the following mapping in the terminal and default text editor program.
shift #2 -> "
shift " character -> @
There were other odd keyboard to character mappings but don't think they are significant at this point.
To fix the issue, I went to the raspberry pi configuration screen under localization and and changed the keyboard to:
Model: Generic 101-key PC
Layout: English (US)
Variant: English (US)
Everything worked as expected at this point.
2) Add a new, second user to the system with adduser.
3) Login with the user's password which contains a @ in the password. The Login UI works fine.
HOWEVER:
- After logging into the system locally at the device using the device keyboard, open a terminal window and try and run a sudo command.
- The device will fail to accept the user's password because it will enter the wrong character. In this case it will enter a " instead of @ in the password field.
- To verify it is inputting the wrong character, open the default text editor and type the user's password. the wrong character is input for shift #2.
This breaks the second user's ability to sudo any command.
4) I verified that both user's have the same keyboard setup.
-- verified using the built in Raspberry Pi Configuration screen for the Keyboard setting and locale.
-- running localectl under each user, the same output is returned.
5) Oddly, if I have the same user with the keyboard mapping problem, SSH in the system on a different computer(windows 11 laptop), everything works fine.
Any pointers to documentation or suggestions on where to look would be greatly appreciated.
Does anyone have any suggestions to resolve the problem?
The system works fine for the initial root user when trying to type in the terminal or the text editor. However for the second user on the system, the keyboard mapping in the terminal is different and this breaks scripts and sudo fail. For example, I can't sudo anything because the wrong characters are entered into the password input or use the | character.
Situation:
1) After the initial OS installation, the root user had a generic 105 keyboard configuration which resulted in the following mapping in the terminal and default text editor program.
shift #2 -> "
shift " character -> @
There were other odd keyboard to character mappings but don't think they are significant at this point.
To fix the issue, I went to the raspberry pi configuration screen under localization and and changed the keyboard to:
Model: Generic 101-key PC
Layout: English (US)
Variant: English (US)
Everything worked as expected at this point.
2) Add a new, second user to the system with adduser.
3) Login with the user's password which contains a @ in the password. The Login UI works fine.
HOWEVER:
- After logging into the system locally at the device using the device keyboard, open a terminal window and try and run a sudo command.
- The device will fail to accept the user's password because it will enter the wrong character. In this case it will enter a " instead of @ in the password field.
- To verify it is inputting the wrong character, open the default text editor and type the user's password. the wrong character is input for shift #2.
This breaks the second user's ability to sudo any command.
4) I verified that both user's have the same keyboard setup.
-- verified using the built in Raspberry Pi Configuration screen for the Keyboard setting and locale.
-- running localectl under each user, the same output is returned.
5) Oddly, if I have the same user with the keyboard mapping problem, SSH in the system on a different computer(windows 11 laptop), everything works fine.
Any pointers to documentation or suggestions on where to look would be greatly appreciated.
Statistics: Posted by _john_ — Sat Apr 27, 2024 8:31 pm — Replies 0 — Views 15