Cannot create a user "håkan"

Bug #23475 reported by Håkan Waara on 2005-10-08
66
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Shadow
Invalid
Undecided
Unassigned
adduser (Debian)
New
Unknown
adduser (Ubuntu)
Medium
Unassigned
Declined for Jaunty by Adolfo Jayme
Declined for Karmic by Adolfo Jayme
Declined for Lucid by Adolfo Jayme
user-setup (Ubuntu)
High
Unassigned
Declined for Jaunty by Adolfo Jayme
Declined for Karmic by Adolfo Jayme
Declined for Lucid by Adolfo Jayme

Bug Description

This is on the latest Ubuntu preview release.

If I filed this bug on the wrong package, feel free to move it - thanks!

Steps to reproduce:

1. Run the installer and go to the step where you create a new user.
2. Real name doesn't seem to matter.
3. Put in username "håkan" (without the quotes)
4. Type in password, and click OK.

Actual behaviour: The guide goes back to step 1, ignoring to create the desired
user. Probably it can't handle the character 'å', and fails silently.

Expected behaviour: I would like to be able to use my first name as username.

Tested software packages/commands:
user-setup: failed
adduser: failed
useradd: passed

Dennis Kaarsemaker (dennis) wrote :

In the current state, linux can only handle ASCII input characters in the
usernames afaik. If you really want this to change, you need to convince the
glibc team (and possibly the kernel team).

Håkan Waara (hwaara) wrote :

How does one go about convincing the kernel or glibc about this? Does anyone know for
sure whether this bug lies in the glibc or kernel?

This is not an enhancement by my definition of the word though... the vast majority of
the world's languages use non-ASCII characters, also in names. It's a bug that the
username must be in ASCII if that is the case.

Håkan Waara (hwaara) wrote :

Also filed http://bugzilla.kernel.org/show_bug.cgi?id=5401

Let's see where this bug report belongs. :-)

Matt Zimmerman (mdz) wrote :

(In reply to comment #1)
> In the current state, linux can only handle ASCII input characters in the
> usernames afaik. If you really want this to change, you need to convince the
> glibc team (and possibly the kernel team).

This sort of thing should work fine in this day and age; as far as I know this
is simply a bug in the configuration frontend.

This bug has been marked as a duplicate of bug 13938.

Matt Zimmerman (mdz) wrote :

(In reply to comment #3)
> Also filed http://bugzilla.kernel.org/show_bug.cgi?id=5401
>
> Let's see where this bug report belongs. :-)

Definitely not there; the kernel doesn't deal with usernames at all.

Håkan Waara (hwaara) wrote :

That is not the same bug. Note that I am talking about the user name, and he is talking about
the Full Name textfield.

In fact, in the other bug he states that entering full names with, for example, "å" in them is
fine!

Colin Watson (cjwatson) wrote :

I rather suspect that it is in fact the same underlying bug, regardless of
whether the symptoms are superficially different.

However, in the meantime, at least let's not have it on the "Installing the base
system" installer component ...

Colin Watson (cjwatson) on 2006-04-01
Changed in shadow:
status: Unconfirmed → Confirmed
Jouni Mettala (jouni-mettala) wrote :

If you try adduser håkan.

adduser: To avoid problems, the username should consist of
letters, digits, underscores, periods and dashes. For compatibility with Samba machine accounts $ is also supported at the end of the username

Fabián Rodríguez (magicfab) wrote :

Confirming this for ISO8859-1 characters too, like in "François" or "Fabián".

Oddly, the GUI "Users and groups" reports a different error message.

aSkreet (skreet) wrote :

I am able to add an account to my running ubuntu system using useradd -m håkan. My system is a 6.10 box that is up to day. I gather this issue lies with the installer application. Are you using the sarge-style installer, or the GUI installer within the LiveCD?

- skreet

Mikko Saarinen (mikk0) wrote :

I have similar experience, only I think that this is even worse...

In Dapper, when I create a user whose password (not name) contains non-ascii character, then I get no error messages at all, and the user is created normally. The result, however, is that the newly created user can not log in to the system!

Suggestion: If the system can not be changed to support utf-8 characters, then both should be checked to see if they comply with the rules. Currently it seems that password is only checked to see if the user has entered the same password twice.

It would also be nice to have some sort of info box in the user creation screen. The box could tell the user which kind of characters are allowed in the name and password fields.

Mikko Saarinen (mikk0) wrote :

My previous comment was not quite accurate.

The user cannot log in from gdm, but by pressing Ctrl-Alt-F1 can be logged in from terminal. Why?

I think installer should limit the username to [a-z][a-z0-9]{0,7}, like "tkarvine".

This fixes most username related problems. Often users ask why this is not enforced automatically by the installer. Users normally come up with an obvious way to choose an ascii username: "Maija Mäkinen" -> "mmakine", "Heikki Håkan" -> "hhakan". This process can also be automated. Users full name can be stored in "Full Name" field in /etc/password.

The case for 8 char ascii usernames:
- They work: users are able to log in graphically. No point pretending Ubuntu supports unicode usernames if it does not support them.
- Many services use usernames and assume they are ascii. For example, email addresses must in practice be ascii.
- File sharing is much easier, for example with Samba or with sshfs to another brand of Linux.
- Can be typed trough remote connections, such as ssh, even when non-ascii characters are not transferred correctly.
- Because many problems related to non-ascii usernames are not in control of Ubuntu, non-ascii usernames can not work reliable in near future.

I suggest that installer should start enforcing lower case 8-char ascii usernames that start with a letter: [a-z][a-z0-9]{0,7}.

Tero,
Lots of good reasons to why it's easier to not allow people to not use their name.
Why not just give people a number when they install?
Then they don't even have to figure out a user name.

Sorry to tell you, but I think it's _lousy_ that Linux doesn't allow native characters in user names!

In this age of purported UTF-16 support throughout GNU, it is rather concerning that something so low-level as this does not work. Simply preventing non-ASCII UIDs is a little akin to using Polyfilla on a wall made of dried dung and sticks.

This needs fixed. Heil UTF-16!

It also depends which tool you are using to add the user:

adduser håkan
fails, but
useradd håkan
works

Colin Watson (cjwatson) on 2007-04-18
Changed in user-setup:
assignee: kamion → nobody
Anthony S (aaaantoine) wrote :

Is this related to bug #13938?

Morten Kjeldgaard (mok0) wrote :

I reported a similar problem (when the password entry comes from a NIS server) as bug #162183.

markoloka (markoloka) wrote :

Umlauts or ascii's in password makes password unusable. Aka can't login in kdm.
When does this kinda limitation's go away and linux world starts to realise there's bit more letters in other keyboards. Like Ä or Å and all french ones.

Anders Hall (kallebolle) wrote :

The entire login process is broken if the goal is to have an international edition of Ubuntu. Bug #150894 is related in many ways and so is bug Bug #23475. Ubuntu does not support international charachters. I'm sure there are many other bugs which all could be "packaged" as broken support for non-English languages.

A complete overhaul of problems related to international charachters in usernames and passwords SHOULD be prioritized with the release of Hardy. Bug #150894 also relates to problems with the dev. process - which often result in broken installation (with regard to language support).

* Until support actually is implemented users should be warned in connection to download of Ubuntu (at release pages/know issues).

Anders Hall (kallebolle) wrote :

Related: Bug #46046

BDunlap (brittdunlinux) wrote :

I would think, depending on the initial language selection, the ascii only should change according to typical naming characteristics of that specific language. So for English no accents/etc would be allowed but for French names including ç and the like should be allowable.

Although that would require some backend work for all of the languages that are supported by ubuntu.

Personally, I see nothing wrong with only allowing ascii in a username as that is how the entire world signs up for online sites, using ascii...

No sense trying to fix something that is so unimportant in the grande scheme of things.

Savvas Radevic (medigeek) wrote :

Has this been forwarded upstream?
Couldn't find anything on bugs.debian.org - except for this similar report about chfn and non-ASCII characters:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=385085

Changed in shadow:
status: New → Invalid
status: Invalid → Incomplete
Savvas Radevic (medigeek) wrote :

It seems there is a standard problem:
$ sudo adduser håkan
adduser: To avoid problems, the username should consist only of
letters, digits, underscores, periods, at signs and dashes, and not start with
a dash (as defined by IEEE Std 1003.1-2001). For compatibility with Samba
machine accounts $ is also supported at the end of the username

http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap06.html#tag_06_01
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html
Alias Name:
"In the shell command language, a word consisting solely of underscores, digits, and alphabetics from the portable character set and any of the following characters: '!', '%', ',', '@'.
Implementations may allow other characters within alias names as an extension. "
and Name:
"In the shell command language, a word consisting solely of underscores, digits, and alphabetics from the portable character set. The first character of a name is not a digit. "

On the other hand, I've used the useradd command instead of adduser:
sudo useradd -m håkan

and the user got listed in /etc/passwd:
håkan:x:1004:1004::/home/håkan:/bin/sh

I could login and use it, but I wonder if it will break any programs..

Savvas Radevic (medigeek) wrote :

mp3 and firefox work as far as I can see.. who says linux can't support non-ascii? :)

Changed in shadow:
status: Incomplete → Invalid
description: updated
Savvas Radevic (medigeek) wrote :

Quoting a comment after my blog post about this:
http://blog.radevic.com/2008/11/how-to-non-ascii-characters-in.html?showComment=1227530880000#c6657583594854565820

" What about email? If the machine is used as a mail server I have serious doubts whether someone will be able to send to Σάββας@yourdomain.com
    Definitely this is not a problem if it is just a standard desktop, but even then it is worth checking what happens when e.g. cron sends you an email. For example, will you be able to receive emails for root, if root's mail is aliased to your username? This might be an experiment worth trying."

Colin Watson (cjwatson) on 2009-01-21
Changed in adduser:
assignee: nobody → kamion
Changed in user-setup:
assignee: nobody → kamion
Colin Watson (cjwatson) on 2009-03-17
Changed in adduser (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in adduser:
status: Unknown → New
jari (jaript) wrote :

Mac OS X asks for the full name of the user, after which it suggests a "short name" consisting of ASCII letters only. Perhaps if we did the same it wouldn't appear to be a bug. Unfortunately currently non-ascii characters in user names cause difficulties for email, and for remote logins where the input encoding may not be UTF-8. Also, the gdm login box should allow writing the full name instead of the user name, in case it doesn't already (haven't tried).

Thank you for posting this bug.

Does this occur in Lucid?

Volodya (volodya) wrote :

On Ubuntu 11.04 - the Natty Narwhal

Using "Users and Groups" from the menu disallows "håkan", but warns about it stating that only some chars are allowed.
adduser warns, and then fails. from the warning it is not clear that adding a user has failed.
useradd works perfectly, but account is created in the disabled state, needs to be activated.

Colin Watson (cjwatson) on 2011-01-26
Changed in adduser (Ubuntu):
assignee: Colin Watson (cjwatson) → nobody
Changed in user-setup (Ubuntu):
assignee: Colin Watson (cjwatson) → nobody
status: Confirmed → Triaged
Roel Brook (rainmaker52) wrote :

This bug seems to be solved on Ubuntu 13.04 (and probably newer):

Ensure the encoding is set to use UTF-8:

root@laptop:~# echo $LANG
en_US.UTF-8
root@laptop:~# useradd hâkænശ
root@laptop:~# passwd hâkænശ
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@laptop:~# su - hâkænശ
No directory, logging in with HOME=/

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.