can anybody tell me how to create a ubuntu user with having '@'. With help of bellow link I found how to add period in username but haven't found any clue for '@' yet.
1 Answer
not sure why you would want to use such character in the user name, but here is one way (for username foo@t):
# useradd -m foo@t
# /bin/su - foo@t
$ id
uid=22284(foo@t) gid=22284(foo@t) groups=22284(foo@t)
then to set a password
# passwd foo@t
to delete such user (and all her/his files):
# userdel -r foo@t
-
That backslash is unnecessary - the shell will just translate that to
@
. Tryecho @ \@
– muruMar 20, 2017 at 12:31 -
yes, you are indeed correct, not sure whether it's best to edit original answer or leave it to these comments ... Mar 20, 2017 at 12:33
@
instead of\.
in the regex.