Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
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

3 Answers 3

up vote 1 down vote accepted

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.

share|improve this answer
    
Thanks for sharing your own findings! :) –  tink Mar 5 '13 at 17:53
    
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

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.

share|improve this answer

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.

share|improve this answer
    
+1 for pragmatism ;| –  goldilocks Mar 5 '13 at 1:37
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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