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.

  • 1
    Is that SSH shell obtained inside a terminal in a GUI environment?
    – enzotib
    Jan 4 '12 at 18:19
  • no. plain text terminal
    – tuergeist
    Jan 12 '12 at 19:24


# 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.

  • 1
    btw, on ubuntu I found keymaps here: /usr/share/keymaps/i386/qwerty, and had to install apt-get install console-data too Apr 28 '14 at 13:54
  • 1
    loadkeys us - uppercase doesn't work for me.
    – kqw
    May 18 '20 at 14:32

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.