Does a complete list of disallowed characters for user names exist, and can the restriction be bypassed?

Certain non-latin characters appear to cause saving the name to fail, like :, whereas others, like =, don’t. Does an exhaustive list of disallowed characters exist, and more importantly, can these be escaped? If so, why isn’t the KCM doing this?

From the manual for useradd;

It is usually recommended to only use usernames that begin with a lower case letter or an underscore, followed by lowercase letters, digits, underscores, or dashes. They can end with a dollar sign

In practical terms, these constraints are not necessarily enforced by tools that add users, but deviating from them could lead to some software not functioning properly, when it attempts to use your username or a file path containing your username (e.g. your home directory).

As usernames are used in many contexts (file system, return value from various APIs, etc.), there is no standard for handling/escaping special characters.

2 Likes

User/Group Name Syntax is a good read on that as well.

This isn’t the username field though, right?

       The options which apply to the chfn command are:

       -f, --full-name FULL_NAME
           Change the user's full name.

Though I’m thankful anyway, @Herzenschein and @dirthsj,because

and

are both useful for