Adding users with first.last name

Tommy Reynolds Tommy.Reynolds at MegaCoder.com
Tue Sep 7 19:48:21 UTC 2004


Uttered Chris <metrion at gmail.com>, spake thus:

> Is it possible to add users to the system using a first.last name
> form? I get an error when attempting it: ' useradd: invalid user name
> 'john.doe'. I have to add about 800 names to a mail server and
> shortened versions would have duplicates, I have an older RH 8.0
> server that I've been able to add users with this user name form, but
> I couldn't see any difference with any config that would allow it.

Accepting a dot as part of the username is a new-ish POSIX change and
not all parts of Linux are happy with it.  AFAIK, useradd(8) has a
bug in its name validation.  Other utilities, such as chown(1),
should be OK.

Try this.  Make a backup first!

1) Add user as "useradd -c 'John Doe' johndoe"
2) Edit "/etc/passwd" and "/etc/shadow" and change "johndoe" to
   "john.doe" to bypass useradd's checking.

Yeah, this makes my stomach hurt too.

HTH.





More information about the fedora-list mailing list