I get this error when I try this command
sudo smbldap-useradd -a -m -P email@example.com /usr/sbin/smbldap-useradd : illegal username
Is there a way to get an email as username, what should I be doing.
smbldap-useradd creates regular Linux users in an LDAP directory and adds the required fields to also make it a valid samba user (this is likely not compatible with Samba4 AD support). Since for Linux, unlike Windows,
@ characters are not really supported in usernames,
the tool wisely rejects such a username.
You likely could add non-POSIX samba users to your LDAP directory with other tools, but they obviously wouldn't be integrated with Linux. If you care for this integration, don't use mail addresses as user names.