max length of loginname in solaris 10 ?

Posted on 2008-11-17
Last Modified: 2013-12-27
I saw somewhere loginname length range is 2-8

I tried one character loginname like 'a' or 'b' and it seems to work.

/usr/include/limits.h says:

#define LOGNAME_MAX 8 /* max # of characters in a login name */

what is minimum length restriction ?
Question by:beer9
    LVL 40

    Expert Comment

    I think you need to test this with the useradd command.
    LVL 22

    Accepted Solution

    One character login names are fine. From the passwd(4) man page:

    The login (login)  and  role  (role)  fields
    accept  a string of no more than eight bytes
    consisting of characters  from  the  set  of
    alphabetic  characters,  numeric characters,
    period (.), underscore (_), and hyphen  (-).
    The first character should be alphabetic and
    the field should contain at least one  lower
    case alphabetic character. A warning message
    is displayed if these restrictions  are  not
    met.  The login and role fields  must  contain  at
    least  one  character and must not contain a
    colon (:) or a newline (\n).
    LVL 48

    Assisted Solution

    Note that you can have very long login names (I'm assuming 255 bytes), but only the first 8 bytes will be recognised, so if you had the users:


    They would be treated as duplicate users.
    LVL 6

    Assisted Solution

    Thats a good way  to explain the difference.
    Plus easy to troubleshoot

    I thinks you can have  -a- as a username , but business pointview,No one will want to have/create that way.
    For personal server.yes its  good to have.

    Company/firms usually do this way.

    name :Javeed Abdul
    Department no: 12
    Employeee no:34

    Userid  will be

    Easy to track the user,where he from , what responsibility he has ....Lots more if you go in depth

    Creating username is very flexible,and has restrictions and options
    All depends on where you want to create, how you want to have.

    hope this help

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (, discussed installing the Solaris Operating S…
    Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap ( Version 1.2 2.      Jpcap( Version 0.6 Prerequisite: 1.      GCC …
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Video by: Phil
    This video goes over how to configure and start a jail in FreeBSD.  This video is meant to supplement the article included with this course.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now