Valid usernames
Currently I am creating a website which communicates with WHM via the WHM API 1. At this moment I am creating a username verifier (to check whether it is valid and available) since there is no API function for it (right?).
At the API documentation page of creating an account it says the following:
Notes:
[LIST]
Usernames must contain eight characters or less.
As of cPanel & WHM version 11.40, usernames may contain 16 characters or less if database prefixes are disabled.
Usernames cannot begin with a number, or the string test.
Just now I created a new user via the WHM interface with username 'fakeaccount' - 11 characters, I am running WHM 11.50.1 and have database prefixes enabled. Is this restriction recently removed? Besides that; is there a place where I can find a list of reserved usernames? Currently the most recent list I found is from this topic (started in 2011).
Just now I created a new user via the WHM interface with username 'fakeaccount' - 11 characters, I am running WHM 11.50.1 and have database prefixes enabled. Is this restriction recently removed? Besides that; is there a place where I can find a list of reserved usernames? Currently the most recent list I found is from this topic (started in 2011).
-
Hello, Thanks for contacting us. If I understand how this works, that shouldn't be allowed to happen. My understanding could be incorrect, so I'll ask for clarification. If you're running on a cPanel & WHM server, you can use the Perl module Cpanel::Validate::Username to check if a username is valid before making your API call. There is documentation in /usr/local/cpanel/Cpanel/Validate/Username.pod on how to use it. If you have any other questions about this, please don't hesitate to ask. David Nielson Integration Developer, cPanel 0 -
I think the first 8 characters of a username have to be unique. Which, if you ask me, kind of negates the point of allowing 16 character long usernames. I'm really not sure what was wrong with the 8 character username restriction to begin with. 0 -
I think the first 8 characters of a username have to be unique.
This is correct; see the message below (directly copied from the 'Create a new account' function in WHM 11.50.1 - build 3). Perhaps the documentation needs to be updated? The name of another account on this server has the same initial 8 characters as the given username (username2). Each username"s first 8 characters must be unique.0 -
Hello :) There's no longer an 8-character limit for usernames, regardless of if database prefixing is enabled. However, the first eight characters of any username must be unique. Only the first eight characters of the username are utilized for database names and database usernames when database prefixing is enabled (e.g. cp123456 is the database prefix if the account username is cp123456789). This decision was made because administrators have the option to enable or disable database prefixing at will in "WHM >> Tweak Settings". I've opened a case (DOC-6266) with our documentation team to correct the document referenced in this thread. Thank you. 0
Please sign in to leave a comment.
Comments
4 comments