cancel
Showing results for 
Search instead for 
Did you mean: 

Acceptable characters in HPUX usernames

SOLVED
rockstarTS
Advisor
Solved!

Acceptable characters in HPUX usernames

Hello,

I've been trying to find out exactly what characters can be used to form a usernames. Obviously letters and numbers are fine, but what about punctuation (i.e. "john.smith", "john-smith"). Does anyone have a list of what punctuation characters will work in usernames on HPUX11? Any other types I didn't list?

Thanks
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor
Solution

Re: Acceptable characters in HPUX usernames

Hi:

Avoid the characters that have special meaning to the 'getty(1M)' login process.

These characters are #, @, /, !, _, backspace, ^U, ^D, or &.

See the manpages for 'getty(1M)' for more information.

Regards!

...JRF...
rockstarTS
Advisor

Re: Acceptable characters in HPUX usernames

Thanks. Your reply helps me knock a few of the possible characters off the list however I need to know everything that is considered a valid character in a username. In this case I'm parsing usernames and need to know what are the possible characters I might encounter in any valid username. Even if it is bad practice I still need to know all the characters that may show up so I can deal with them. I'm just trying account for the less-than-savey HPUX system administrator who may not know the standard practice of creating Unix usernames.

Thanks again.

Highlighted
Sundar_7
Honored Contributor

Re: Acceptable characters in HPUX usernames

And remember you cannot use more than 8 characters as the user name.
Learn What to do ,How to do and more importantly When to do ?
Jeff_Traigle
Honored Contributor

Re: Acceptable characters in HPUX usernames

If you look at the useradd man page, it states:

The useradd command may be used with the "login" argument, where "login" is the new login name, specified as a string of printable characters. It may not contain : or a new line (\n).
--
Jeff Traigle
rockstarTS
Advisor

Re: Acceptable characters in HPUX usernames

(BTW Sorry I forgot about the awarding of points till just now.)
rockstarTS
Advisor

Re: Acceptable characters in HPUX usernames

Well this tells me a couple more characters not to use but I was hoping to get a list of characters that are valid. I'm thinking it's something like:

a-zA-Z0-9._-

and maybe a few others but I'm not sure. Does anyone know what are all the valid characters in a user name on HPUX?

Thanks.
A. Clay Stephenson
Acclaimed Contributor

Re: Acceptable characters in HPUX usernames

The passwd (4) man page, makes it very clear:

/QUOTE/
The login name must begin with an alpha character and may only contain alphanumeric and underscore characters.
/UNQUOTE/

If it ain't broke, I can fix that.
rockstarTS
Advisor

Re: Acceptable characters in HPUX usernames

Thank you sir. That was exactly what I needed.
rockstarTS
Advisor

Re: Acceptable characters in HPUX usernames

I got my answer.