Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Throughout my humble career in IT I generally see username length limited (typically to 8 characters). This occurs on a variety of systems including Active Directory and database apps.

Is there a reason for this? Is there best practices with regards to username creation?

share|improve this question
1  
Good question but I shudder every time I see the term "best practice". There's no such animal. –  John Gardeniers Dec 17 '10 at 21:11
add comment

2 Answers 2

It's a limitation of legacy Unix systems, and the NIS directory service in particular. Usually, this restriction is just in place if the organization is trying to keep usernames consistent across all applications (which is generally a good idea).

share|improve this answer
    
+1, lowest-common-denominator causes a lot of these restrictions. AD may support 256 char usernames, but that Solaris 7 server in the core forces the max to 8 characters. Also, the same restrictions apply to password length. –  sysadmin1138 Dec 17 '10 at 18:56
    
Oh, hey, the blog guy I read from time to time. Sup? :) –  jgoldschrafe Dec 18 '10 at 1:19
1  
And on MSWindows systems - inherited from MSDOS limit of 8 chars in a filename –  symcbean Dec 20 '10 at 9:05
    
No, that was gotten rid of - with Windows 95. Even Fat got an upgrade including compatibility mode ;) –  TomTom May 8 '12 at 11:00
add comment

The main one I’ve seen problems with recently has been ps on Solaris (10), it lops the 9th+ characters off, so for example if you needed to grep for the username it wouldn’t match.

$ sudo -u longusername ps -fu longusername
     UID   PID  PPID   C    STIME TTY         TIME CMD
longuser 14012 11985   0 09:58:39 pts/2       0:00 ps -fu longusername

If you do an ls -l on a directory with files belonging to that user, the columns get pushed out of alignment.

$ ls -ld /export/home/l*
drwxr-xr-x   2 lauser   users        6 Mar 23 10:21 /export/home/lzuser
drwxr-xr-x   2 longusername users        6 May  4 10:02 /export/home/longusername
drwxr-xr-x   2 lzuser   users        6 Mar 12 11:21 /export/home/lzuser

Basically you would need to be wary of any tool that dealt with login names and not just UIDs. That could include things that read from or wrote to log files or databases, or used the output of tools like last, who, finger, ls, ps etc.

A quick Google turned up this page:

http://fixunix.com/sun/113647-username-lenght-more-then-8-characters.html

Which adds some more reasons.

With regards best practices for username creation, there can also be complications from using logins in capitals instead of lower case, so that should be avoided too.

When some (older) systems, when see a login in only capitals, they helpfully default to assuming that the user's terminal doesn't support lower case, so set EVERYTHING to be in capitals (which can prevent entering the password and being able to type Unix commands once you login!)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.