In ubuntu it is possible to use the following:
sudo adduser --force-badname firstname.lastname@example.org
This allows adding an email address as a username. The --force-badname option doesn't work in CentOS 7.
Is there a way to achieve this in CentOS 7?
This is not possible on CentOS 7 using the
adduser command. This following patch prevents it and there's no
--force-badname option: https://git.centos.org/blob/rpms!shadow-utils.git/c7/SOURCES!shadow-126.96.36.199-goodname.patch
You can achieve this by adding the user
john.smithATSYMBOLexample.com and using
vipw to do
s/ATSYMBOL/@/ . It appears vipw doesn't check validity of usernames.