• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3820
  • Last Modified:

max length of loginname in solaris 10 ?

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:

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

what is minimum length restriction ?
0
beer9
Asked:
beer9
3 Solutions
 
omarfaridCommented:
I think you need to test this with the useradd command.
0
 
Brian UtterbackPrinciple Software EngineerCommented:
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).
0
 
TintinCommented:
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:

username1
username2

They would be treated as duplicate users.
0
 
javeedabdulCommented:
Tintin.
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
ja1234

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
0
 
beer9Author Commented:
Excellent!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now