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]*\$"
NAME_REGEXalready accepts-as long as it's not the first character. – Déjà vu Sep 03 '15 at 06:02.?Consider a user named
– Jon May 05 '17 at 19:08.or... Then,rmthat user named...rmis not the command to use when deleting a user. I agree..is not a sensible name for similar reasons, butrmis not one of those. – toon81 Oct 29 '18 at 12:14