I want to create user accounts named after a domain name. adduser complains that the usernames need to match the NAME_REGEX regular expression.
adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX configuration variable. Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.
I can add the users using useradd without complaint.
Is there a reason that I shouldn't modify the regular expression to allow ., - and _?
What characters will cause problems and shouldn't be allowed in usernames?
This is the default NAME_REGEX.
NAME_REGEX="^[a-z][-a-z0-9]*\$"