The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Username Limit

Discussion in 'General Discussion' started by sparek-3, Jan 30, 2015.

  1. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Is there a setting in cPanel to force usernames to be 8 characters again?

    I'm assuming this is something with CentOS 6 that is allowing longer usernames. However, I'm also assuming that MySQL usernames and database prefixes have to be kept at 8 characters, so the first 8 characters of a 16 character username has to be unique. Kind of defeats the purpose of a greater than 8 character username.

    Would be nice to force the WHM to create 8 character usernames. Not sure how this would affect account transfers from other servers that allow greater than 8 character usernames.
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Hello,

    We changed the user name length requirements in 11.44, about a year ago. You can read more about the changes in our release notes:

    http://documentation.cpanel.net/dis...aseNotes-Usernameanddatabasenamelengthchanges

    We do not provide a way to restrict the cPanel user name to 8 characters. Our tools, and UIs, will use the first 8 characters of the cPanel user name as the prefix of the database user name, if you have prefixing enabled.

    Are you encountering issues with cPanel user names longer than 8 characters?
     
  3. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    If the first 8 characters have to be unique, then doesn't that kind of defeat the purpose of having any username longer than 8 characters?

    Sure, maybe you can have more descriptive usernames, although 16 characters vs. 8 characters isn't going to be much more descriptive. And why would usernames need to be more descriptive?

    I guess if you have database prefixing turned off (not a fan of being able to turn this off, not sure what the advantage is, but that's a separate topic). But the restrictions on the uniqueness of the first 8 characters seems to be a cPanel thing, with no regards to whether database prefixing is enabled or disabled.

    Granted, it would be hard to turn this off now that it's been allowed to be used. But I just don't see the benefit or advantage of this. It's more of a nuisance - "You can't use this username, even though this username is unique on this system, the first 8 characters of this username is in use by another username some where, so we can't let you use this username"
     
  4. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    We actually prefer that database prefixing be turned off. It removes that confusion with the prefix that you mentioned. It also makes different aspects of the account transfer system simpler and more robust.

    We retain the ability to have database prefixing as some people like to be able to quickly map a database, or database user, to a cPanel user based upon the first 8 characters (the prefix). With prefixing turned off, that quick mental mapping is not possible.

    The 8 character limitation stems directly from MySQL, which limits usernames to 16 characters total (note: MariaDB, which we support in 11.48, does not have this limitation). For years we limited cPanel user names to 8 characters max (although many people preferred we remove that limitation). The situation we have now, with the ability to opt out of the prefix, is where we eventually met in the middle.
     
  5. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I just think it would be nice to be able to force accounts to be only 8 characters. I understand why the first 8 characters have to be unique. I just think that if the first 8 characters have to be unique then characters 9 through 16 are useless.
     
  6. Massimo Bandinelli

    Massimo Bandinelli Registered

    Joined:
    Apr 28, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Florence
    cPanel Access Level:
    DataCenter Provider
    There's an external application that provides backup (R1Soft) that filter customers databases based on the username and assumes that username is 8 characters long.

    I don't think this is a good approach, but it would be great if you would let the administrator to decide if limiting or not username lenght. An option in "Tweak Settings" would be nice.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The reason for the existing requirements has been explained, but you are welcome to submit a feature request for this via:

    Submit A Feature Request

    Thank you.
     
  8. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    This just seems like an ill conceived idea from the start. I don't understand the point of allowing longer usernames in a shared environment like this.

    If all of the components on the system support longer usernames in a shared environment, then this might make sense. MySQL may allow for 16 character usernames and this may work fine in a single user environment (not a multi-user shared hosting environment) where duplicate MySQL usernames can be dealt with or easily explained. But in a shared hosting environment, the MySQL username needs to have the account's username ($ACCOUNTUSERNAME_) appended to the username. That means that the full 16 characters can't really be used.

    Until MySQL support is dropped (officially or unofficially) then I think it would behoove cPanel to keep the 8 character account username limit in place.

    I just don't see the point of an account username that is longer than 8 characters, if the first 8 characters are all that matter.

    What is so wrong with 8 character usernames anyway? WHy did people want longer usernames? Did they understand that longer usernames does not remove the same restriction on MySQL usernames?

    What is wrong with prefixing a database and database username with the account's username and an underscore?

    The removal of the account username prefix and the whole database mapping system entirely, just seems to create more confusion than solve problems.

    Or perhaps I'm missing something (entirely possible) and someone can explain how the longer usernames benefit everyone.

    Once cPanel moves to MariaDB, which doesn't have the same character limit, and as long as no other systems cPanel depends on (like PureFTPD, Dovecot, Exim, none of which I believe have any dependence on username appendages or limits) then a move to longer account usernames would seem to make sense.
     
    feldon27 likes this.
  9. feldon27

    feldon27 Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    111
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Houston, TX
    Just ran into this today. If the first 8 characters must be unique, then WHM shouldn't allow account names over 8 characters. That one doesn't pass the smell test.

    But mostly I'm completely astonished that staff are suggesting that MySQL database prefixing should go away. Users being unable to create a MySQL database because another user on the same server has the same database name would be a nightmare scenario. Some servers have 100's of users all capable of creating databases. It's also worth pointing out that MySQL database prefixes is the only thing that keeps /var/lib/mysql/ somewhat structured and sane.

    Unless there's a plan to start storing MySQL/Maria DB's in home directories or subdividing /var/lib/mysql/ into user folders, this seems a dangerous idea.
     
  10. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I agree on this as well. Or perhaps I don't fully understand "database mapping" (which is possible). I remember when this "feature" came out in previous cPanel releases. I didn't pay a lot of attention to it, because I thought it was kind of stupid and didn't think it would catch on.

    Does database mapping mean that user1 on a server can create a database named wordpress (which is just wordpress not user1_wordpress)? What happens when user2 decides that they want to create a wordpress database?

    cPanel is geared towards shared hosting servers, correct? Servers with many different accounts sharing a server, often when users on a server don't share any common acquaintances. Seems to be that leaving the account's username (or domain name, but username makes more sense) prepended to the database name would make more since. Something so that users can have defined database names without the worry of "woops, that one's taken"

    That ties into allowing for longer usernames. Personally, I've never had any client complain about ONLY being allowed to have an 8 character username. Perhaps as the move to MariaDB comes to fruition (which I gather doesn't have the same 16 character limit that MySQL has) then allowing for longer account username - while still prepending that username to MariaDB users and databases - would make more sense.

    For what it's worth as well, I've never had a user complain about not be able to create a wordpress database (without the username prepended to it). And if I did - maybe I'm not as customer friendly as I should be - but I know how to tell them "tough, that's the way it is."
     
Loading...

Share This Page