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

Solution Unverified - Updated -

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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content