I have Debian Stretch and my user name is two strings like "jkl mno" and I when I press Alt+Ctrl+F3 command line appears and gui disappears and I can't log in with my credentials, so I created another account with single string like "avc" and when I supply its password and user ID it logs in. How can I fix the problem of not bing able to log in with user ID of two strings. (there is a space in one word jkl and the other mno).

I can easily log in with GUI however.


User names aren’t supposed to contain the space character; POSIX recommends only using characters from the portable filename character set, which contains all unaccented US English alphanumerics, period, underscore, and hyphen. Additional allowable characters which aren’t part of the portable filename character set are the at-sign (‘@’) and the dollar symbol (‘$’, for compability with Samba).

It’s not surprising that you can’t log in using “jkl mno”. You should switch to a user name without a space character (you can do this by editing /etc/passwd, /etc/shadow, and /etc/group).

Note that on Debian and derivatives, the user creation tool, adduser, enforces these restrictions by default.

| improve this answer | |
  • 1
    ...and edit /etc/shadow as well. – Ipor Sircer Oct 30 '17 at 15:57
  • 2
    Thanks @Ipor, and /etc/group too! – Stephen Kitt Oct 30 '17 at 16:00
  • Thank you Stephen King, I misspoke earlier, it was not my user name which had two strings, my ID as I do "whoami" is one string, however, the name which I see in GUI mode when I start the Linux is two string, that is my full name. However, I created another account with adduser and the name is just one string and it works fine. I don't know what to edit in /etc/shadow or /etc/group as with name (single string username) there is a long string of Lord knows what meaning. – Jawad_Mansoor Nov 2 '17 at 1:54
  • @Jawad then you shouldn’t have any problems; you need to use your short id to log in, that’s all. Full names can contain spaces. – Stephen Kitt Nov 2 '17 at 8:25
  • 1
    Your two comments here contradict each other. Does your id contain a space, or doesn’t it? – Stephen Kitt Nov 9 '17 at 11:21

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.