Is it possible to create a user in Red Hat 7.3 with @ symbol in it ? Example abc@abc.com is the user i need to create
Hi All,
I have a question, I want to create a user with domain name in it.
example i need to create a user name with abc@abc.com .
I get the below error when i create one.
[root@redhatunix etc]# useradd abc@abc.com
useradd: invalid user name 'abc@abc.com'
[root@redhatunix etc]#
Does any one know if this is possible ?
Responses
Hi,
This was already answered by Red Hat:
https://access.redhat.com/solutions/30164
Basically, allowed characters: 'a'...'z', 'A'...'Z', '0'...'9', '.', '-', '_'. No other characters are allowed.
Regards,
If you really just ask if it is possible: yes. If you mean to ask if you should do it: no.
The programs from the shadow-utils package (like useradd) checks that the name complies with the rules "User/group names must match [a-z_][a-z0-9_-]*[$]".
But you can of course do it "the old way" by adding an entry to the databases directly (preferably using vipw/vigr and passwd), But you will risk ending up with problems with other programs or systems that assumes usernames never includes a @. (E.g. it can be interpreted as an email address since it has a @, meaning the domain will be stripped off and just the left part used, possibly matching an existing useraccount.)
So the right answer, if a manager asks you, is "No, not valid".
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
