My password contains "special" characters like ü. How can I login at the console (no X running) when the default keyboard layout does not provide these characters?

Or, differently put: how can I insert arbitrary Unicode characters at the login prompt?

My box runs Debian 6.

  • This may be a silly question, but how do you enter them at your X greeter (or, at all, ever)? And if you have means to log in using the keyboard through a GUI, why is your keyboard layout for the shell different? – tink Mar 5 '13 at 1:13
  • @trink This is my pet server project, so I don't know about Debian and X greeters. In Ubuntu, if I can't switch the keyboard layout at the login screen I press ctrl+shift+u+hex code+space. E.g., 00FC as the hex code for ü. Oh, and for the different keyboard layouts: I changed my password via ssh. – beginner Mar 5 '13 at 13:13

As vonbrand told, you should never use that kind of chars in a password that you are expected to type in a console ! Console is the last ressort thing.

Now, to answer your question:

First, you must ensure the console is in utf-8 mode if you want to input utf-8 (otherwise, you have to ressort to input of individual bytes of utf-8 sequences, ouch!), and you need also to have a font loaded that shows those characters (for basic latin letters it shouldn't be a problem however).

You can input it 3 ways: * if you have a mouse and gpm running you can copy and paste them (write the login greeter message so that is display all unicode chars you need)

  • have the need unicode symbols available in your console keyboard (eg: "U+00FC" for lowercase "ü")

  • have a dead_diaeresis (and/or any other needed dead keys) symbol in your console keyboard, and a compose file definition. note however that if it hasn't changed from last time, the compose file use 8bit, it is converted to unicode in an ugly way; it only works when result is in the range 0x0001 to 0x00ff (which is the case of "ü")

Note however that chances are high the right keyboard map is already there; just maybe you are loading the wrong one.

|improve this answer|||||

I found a solution for my problem: If the console is in Unicode mode, you can enter Unicode characters with alt+decimal unicode point. E.g., for ü: alt+252. This works for me with Debian 6 and Ubuntu 12.04.

I am not sure where it is defined whether the console should be started in Unicode mode or not. Some keywords might be kbd_mode, unicode_start and unicode_stop.

|improve this answer|||||
  • does not work for me after key map change to cz keyboard. Alt+decimal code works as I do not press alt.. I write just numbers. Someone should solve that hell.. Could not be automated as on installation time? – Dee May 17 '13 at 17:54
  • It seems that for some reason you have to use the numeric keypad for inserting the numbers. The 'normal' numbers don't work for me, either. – beginner May 27 '13 at 19:00

Sort answer: Don't do that. As you see, it gives problems with keyboard differences. I also take care with the root password (sometimes needed to boot when no keyboard mapping is in force), so that no "impossible" characters appear.

|improve this answer|||||
  • I agree that this is a pragmatic choice, but it doesn't solve my current problem :-) But at least I'm a little bit wiser now. – beginner Mar 5 '13 at 13:17

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.