How do I temporary change my keyboard layout on Debian? (no X)

22,491

Solution 1

Try:

# loadkeys us

From a terminal, it does not make sense to run this over ssh as the keyboard you use over ssh is the local one and the ssh client sends the keys after they have already been interpreted according to your local keymap. And it won't even work if you try.

You can find all the available console keymaps in /usr/share/kbd/keymaps.

Solution 2

You mean you want to change the keyboard layout of the console of the machine from which you are launching the terminal; and do it before launching ssh connection; and have that modified keyboard layout have a special key to switch between to modes "us" and "german"?

Well, by default there isn't any such setting; those layout switching are usually done between latin/non-latin layouts.

You could however take one of those existing settings (for example, the console layout definition for, say, Greek keyboard), copy it under another name, edit it and change the Greek letter definitions with whatever applies for your wanted "German" layout. Then load that modified layout; and now you can switch between them.

If, on the other hand, you just want to change the layout for the duration of the whole ssh session; just call loadkeys us before launching ssh session, as totaam said; and loadkeys de after it.

Share:
22,491
tuergeist
Author by

tuergeist

Updated on September 18, 2022

Comments

  • tuergeist
    tuergeist over 1 year

    How can I quickly change my keyboard layout between US and German?

    setxkbmap does not apply here, as I only have an SSH shell.

    Persistent changes via

    dpkg-reconfigure keyboard-configuration
    dpkg-reconfigure console-data
    

    are unwanted as well.

    I suppose the solution is very simple, but I did not find it.

    • enzotib
      enzotib over 12 years
      Is that SSH shell obtained inside a terminal in a GUI environment?
    • tuergeist
      tuergeist over 12 years
      no. plain text terminal
  • Aquarius Power
    Aquarius Power about 10 years
    btw, on ubuntu I found keymaps here: /usr/share/keymaps/i386/qwerty, and had to install apt-get install console-data too