In ubuntu it is possible to use the following:
sudo adduser --force-badname [email protected]
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 useradd
or 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-4.1.5.1-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.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments