Why is the 'useradd' command failing with 'useradd: invalid user name' error message in Red Hat Enterprise Linux?

Solution Unverified - Updated -


  • 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'


  • 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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In