Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

useradd: login beginning with a number invalid

107 views
Skip to first unread message

Stefan Marquardt

unread,
Dec 1, 2003, 4:10:50 AM12/1/03
to
Hello,

why is a number at beginnig invalid ?

hp712-ts: / # useradd 1joke
Login '1joke' is invalid

Regards,
Stefan

Siem Korteweg

unread,
Dec 1, 2003, 5:00:17 AM12/1/03
to
"Stefan Marquardt" <erase-this.st...@hagebau.de> wrote in message
news:ka1msvkqvkfb59oge...@4ax.com...

> Hello,
>
> why is a number at beginnig invalid ?
>
> hp712-ts: / # useradd 1joke
> Login '1joke' is invalid
>

From the man page: passwd(4)

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

Siem
--
_________________________________________________________
Siem Korteweg
Open Challenge www.open-challenge.nl/scc/index.html
Havenweg 24A telefoon: 0347 324 130
4131 NM Vianen fax : 0347 324 120
_________________________________________________________


Stefan Marquardt

unread,
Dec 1, 2003, 7:25:08 AM12/1/03
to
On Mon, 1 Dec 2003 11:00:17 +0100, "Siem Korteweg"
<NOsie...@open-challenge.nl> wrote:

>The login name must begin with an alpha character and may only contain

Why ?
A customer changed from another Unix to HP-UX and cannot use his old
login id's.


Stefan

Siem Korteweg

unread,
Dec 1, 2003, 8:11:07 AM12/1/03
to
"Stefan Marquardt" <erase-this.st...@hagebau.de> wrote in message
news:nncmsvo97uc48qd59...@4ax.com...

Stefan,

It means this is a "feature/limitation" of HP-UX. Also for Solaris, from the
manual page of useradd for Solaris (2.6):

The login field (login) is a string no more than eight bytes
consisting of characters from the set of alphabetic charac-
ters, numeric characters, period (.), underscore (_), and
hypen (-). The first character should be alphabetic and the
field should contain at least one lower case alphabetic
character.

Walt Howard

unread,
Dec 1, 2003, 2:24:31 PM12/1/03
to
In article <3fcb3def$0$1492$e4fe...@news.xs4all.nl>,

Siem Korteweg <NOsie...@open-challenge.nl> wrote:
>"Stefan Marquardt" <erase-this.st...@hagebau.de> wrote in message
>news:nncmsvo97uc48qd59...@4ax.com...
>> On Mon, 1 Dec 2003 11:00:17 +0100, "Siem Korteweg"
>> <NOsie...@open-challenge.nl> wrote:
>>
>> >The login name must begin with an alpha character and may only contain
>>
>> Why ?
>> A customer changed from another Unix to HP-UX and cannot use his old
>> login id's.
>>
>It means this is a "feature/limitation" of HP-UX. Also for Solaris, from the
>manual page of useradd for Solaris (2.6):
>
> The login field (login) is a string no more than eight bytes
> consisting of characters from the set of alphabetic charac-
> ters, numeric characters, period (.), underscore (_), and
> hypen (-). The first character should be alphabetic and the
> field should contain at least one lower case alphabetic
> character.
>
The limitation is almost certainly in useradd. If you do old-timey
system admin by adding the user entry to /etc/passwd and whatever file
you store the password hashes in, and create/chown the home directory,
and copy over the skel files, you can get a lot closer to the original
Unix limitation that a username cannot contain a ':' or NULL but can
contain almost anything else. Some characters will confuse serial
line drivers, or mail programs, or certain databases. If you start with
a '+' or '-' you will confuse NIS. If you put in '\' the user will need
to understand how the login program works. IMHO, limitations such as
"cannot start with a digit" are a concession to poorly-written applications.
Purchasers of such applications should beat mercilessly on the vendors
until the vendors come to understand the flexibility of Unix. Vendors
who think Unix is just a more reliable version of DOS should be dealt
with sternly.


--
Walt Howard /"\ ASCII Ribbon Campaign
InterNet: who...@ieee.org \ / No HTML in mail or news!
BellNet: +1 780 492 6306 X
/ \

0 new messages