Let us explore the username restrictions of cPanel & WHM, and subsequently explain the steps that need to be taken in the event that you encounter a username that is invalid, reserved, or misconfigured.
So, what is cPanel & WHM? It is a suite of tools that has been built for Linux operating system. It enables you to automate web hosting tasks through a simple, and easy to use graphical user interface.
cPanel & WHM serves the purpose of easily managing servers and websites. In this context, do you know what makes it possible for you to access websites? The answer to this question is, the service of web hosting. Websites are made accessible to users through the service of web hosting, which is provided by web hosting service providers. In web hosting, server space is offered to website owners through various types of hosting plans, for hosting the files (web content) of their websites. When these files are delivered over the Internet from the server to those devices that are looking for the corresponding web content, then websites become accessible. Web hosting can be of many types. These are, shared, reseller, dedicated, VPS, cloud, and WordPress. The “Best Windows Hosting Company”, the “Best Cloud Hosting Company”, the “Best Website Hosting Company”, etc. are some of the most frequently used terms to refer to the most popular service providers of web hosting.
Restrictions
cPanel & WHM applies certain restrictions/rules when a cPanel or WHM username is created or modified by you. These are as follows:
Only digits (0-9) and letters (a-z) should be used in usernames.
A username can’t contain more than 16 characters.
Usernames can’t start with a digit or the string test.
Usernames can’t end with the string assword.
Special Cases
There are certain special cases, which are described below.
Usernames can’t be created with the hyphen character (-).
An account’s name can be changed to use a hyphen when that account is transferred to another system.
You need to set the LONGUSERS: 1 environment variable in the /var/cpanel/whm/nvdata/root.yaml file in order to allow usernames that are over 8 characters in length.
The first 8 characters need to be unique on the system, if you want to use MySQL or PostgreSQL as a database engine.
It is important to mention here that database prefixing can be disabled with the aid of the option, Add prefix to names of new databases and database users, in the SQL section of the Tweak Settings interface of WHM.
WHM >> Home >> Server Configuration >> Tweak Settings.
The /etc/allowstupidstuff touch file needs to be created in order to allow leading digits in a username.
Reserved Usernames
An important point that needs mention is that during TSR-2017-0006, the list of reserved usernames was expanded to include email aliases listed in the /etc/aliases and /etc/localaliases files. The system will reserve those usernames also that are aliased to a reserved username.
Some usernames are reserved by cPanel & WHM for the system’s use. These cannot be used for cPanel or WHM accounts. The list of reserved usernames can keep on growing.
New versions of cPanel & WHM may get added to this list.
The below-mentioned files are checked by cPanel & WHM in order to determine the reservation or restriction of a username or alias.
/usr/local/cpanel/Cpanel/Validate/Username/Core.pm
/etc/aliases
/etc/localaliases
Reserved Aliases
The system reserves the below-mentioned list of aliases by default.
For the username root - abuse, adm, amandabackup, apache, bin, canna, daemon, dbus, decode, desktop, dovecot, dumper, fax, ftp, games, gdm, gopher, halt, hostmaster, ident, ingres, ldap, lp, mail, mailnull, manager, mysql, named, netdump, news, nfsnobody, nobody, noc, nscd, ntp, nut, operator, pcap, postfix, postgres, postmaster, privoxy, pvm, quagga, radiusd, radvd, root, rpc, rpcuser, rpm, security, shutdown, smmsp, squid, sshd, sync, system, toor, uucp, vcsa, webalizer, webmaster, wnn, xfs
For the username postmaster - info , mailer-daemon, marketing , sales , support
For the username news - newsadm , newsadmin , usenet
For the username ftp - ftp-adm, ftp-admin, ftpadm, ftpadmin
For the username webmaster – www
Resolve Problems
You need to run the below-mentioned command to rename the account in order to resolve issues that have to do with invalid, reserved, or restricted usernames or aliases. This command needs to be run as the root user.
whmapi1 modifyacct user=username newuser=newusername
In this command, the term “username” represents the current username, which is restricted.
The term “newusername” represents the new username that is needed to be assigned to the account.
Remove Username Aliases
Reserved aliases can also be removed from the /etc/aliases and /etc/localaliases files.
Misconfigured Usernames
Misconfigured usernames have no information or these exist in an incomplete state. You must run the following command to fix a misconfigured username. This command needs to be run as the root user.
/usr/local/cpanel/scripts/updateuserdomains --force
Kommentare