LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-15-2010, 06:02 AM   #16
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405

Hi,
Quote:
Originally Posted by fpmurphy View Post
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
 
Old 09-16-2010, 06:13 AM   #17
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 299

Rep: Reputation: 62
Quote:
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.
 
Old 09-16-2010, 06:54 AM   #18
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

About Linux, as stated before in post #14:
Quote:
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.......

Last edited by druuna; 09-16-2010 at 06:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command getent return nothing aspenbr Linux - Software 1 11-18-2008 12:01 AM
getent passwd only pulls local info - getent group works? epoh Linux - Server 2 03-14-2008 07:56 AM
System usernames versus user numbers -- incompatibility? eater Linux - Software 4 03-01-2008 10:53 AM
sequence of numbers, how to extract which numbers are missing jonlake Programming 13 06-26-2006 03:28 AM
Adding numbers, break on non-numbers... Cruger Programming 1 03-22-2004 09:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration