Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What do you mean by officially? Where is that specified in any formal specification?
Quote from the useradd man page:
Quote:
Usernames must begin with a lower case letter or an underscore, and
only lower case letters, underscores, dashes, and dollar signs may
follow. In regular expression terms: [a-z_][a-z0-9_-]*[$]
Think about it: What happens when a user name starts, for example, with a @. That will be an interesting, none workable mail address....... And, as mentioned by sem007: numerical user names are detected as UID and not as user name in some cases.
Hope this helps.
Last edited by druuna; 09-15-2010 at 06:13 AM.
Reason: Changed sentence for clarity
Quote from the useradd man page:
Quote:
Usernames must begin with a lower case letter or an underscore, and
only lower case letters, underscores, dashes, and dollar signs may
follow. In regular expression terms: [a-z_][a-z0-9_-]*[$]
It may be that your particular version of Linux has that limitation but mine (Fedora 13) certainly does not. There is not an official limitation. In fact, standards development organizations such as IEEE and TOG have deliberately remained silent on the issue of usernames. There are only implementation restrictions. For example, AIX 6.1 has the following restrictions:
Quote:
To prevent login inconsistencies, avoid composing user names entirely of uppercase alphabetic characters. While the useradd command supports multibyte user names, restrict user names to characters with the POSIX-portable filename character set.
To ensure that your user database remains uncorrupted, you must be careful when naming users. User names must not begin with a hyphen (-), plus sign (+), at sign (@), or tilde (~). You cannot use the keywords ALL or default in a user name. Additionally, do not use any of the following characters within a user-name string:
: Colon
" Double quote
# Pound sign
, Comma
= Equal sign
\ Back slash
/ Slash
? Question mark
' Single quote
` Back quote
Finally, the login parameter cannot contain any space, tab, or newline characters.
As you can see, these restrictions are different that those quoted by you as the "official" restrictions.
Some distro's do allow other characters and might let you start a user-name with a number, but this could get you into trouble.
Which should have shown you that certain Linux distro's do allow some other characters......
I wasn't talking about my specific distro, but from experience over the years with different Linux distro's and Unix, proprietary systems. If you keep to the [a-z_][a-z0-9_-]* set of characters you will not get into trouble. Do keep in mind that there are more Unix/Linux/MS/Apple/etc flavours out there that you might need to communicate with.
If one works on one specific machine it will not matter that much if one deviates from the "standard" (assuming that that specific distro allows it), if you are going to mail, (un)tar, scp (etc etc) from one Unix/Linux machine to a different machine (using different flavours of OS's) one might run into problems (speaking from experience).
One comment about the AIX set: I wonder what happens when you create a user-name like this: joe@bar.foo
Its e-mail will become joe@bar.foo@some.companies.domain, which spells trouble.......
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.