useradd: invalid user name ‘first.last’

Starting somewhere around the migration from Red Hat Linux 9 to Fedora Core, useradd (adduser) stopped allowing dots in usernames. This was all well and good to fix some of the problems that dots can cause under certain circumstances, but it left some systems administrators high and dry when it came to creating new users where company policy dictated a firstname.lastname username scheme.

For the past few months I’ve been using a quick and dirty hack with no ill effects. Create the user as firstname_lastname, rename their home directory to firstname.lastname, and then run vipw and vigr to modify the password and group files to change all instances of firstname_lastname to firstname.lastname.

It sucks, but it works…

One thought on “useradd: invalid user name ‘first.last’”

  1. Hello. Thank you there is this article I could have solved one the problem of nnnn.dddd.
    A greeting Pedro

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.