Why is the 'useradd' command failing with 'useradd: invalid user name' error message in Red Hat Enterprise Linux?
Issue
- Not able to add new local user who has '@' sign as part of username. It throws error as "invalid user name". For example username as:
]$ sudo useradd testuser@example.com
useradd: invalid user name 'testuser@example.com'
Environment
- Red Hat Enterprise Linux 5.x
- Red Hat Enterprise Linux 6.x
- Red Hat Enterprise Linux 7.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.