Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

CPanel create accounts with wrong GroupID:UserID

Discussion in 'General Discussion' started by AlexAT, Mar 23, 2004.

  1. AlexAT

    AlexAT Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2003
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Ukraine
    cPanel Access Level:
    Root Administrator
    I have box for a while and asked datacenter to install CPanel on it.

    After installation I realized that newly created accounts have wrong GroupID:UserID.
    They can be found in the /etc/passwd, /etc/group

    On my other box Cpanel accounts started from 32000 ID.
    But on this box they started just right from 500.

    Also when new account created I have record in /etc/passwd with GroupID and UserID+1, i.e. for accounts ac1, ac2, ac3 I have records:


    That way I have all quota on my box mixed between different acounts and experienced much problems.

    So my question - how to make Cpanel start creating account from 32000 ?

    I tried manually update last records from /etc/passwd, /etc/group but it seems Cpanel does not take data from these files for creating new accounts.

    Please help me!..

    cPanel.net Support Ticket Number: 109
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    316
    Location:
    Spain
    WHM -> Server setup -> Minimum Uid
    See also /etc/login.defs or man useradd
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. AlexAT

    AlexAT Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2003
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Ukraine
    cPanel Access Level:
    Root Administrator
    Thank you very much!

    It helps but not in 100%.

    /etc/login.defs - does not affect account creation.

    When I set UID to 32000 within the WHM it creates entries like this:
    so - where can I change minimum group ID?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    316
    Location:
    Spain
    My mistake, you're right. Have a look at /scripts/realadduser (I think that's the script which effectively adds users). It restricts ids like this:

    Code:
    if (int($minuid) < 1) {
            $minuid = 500;
    }
    $mingid = 500;
    
    $maxuid = 32000;
    $maxgid = 32000;
    
    where minuid is optionally set from WHM.

    I don't know if there's a good reason to do it that way, but I don't know if there's any good reason to mess with this either. It should not affect quotas at all, as long as each user has their own unique uid. Also in a standard cpanel box there are not group quotas, so that shouldn't affect either. I really wouldn't touch this.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. AlexAT

    AlexAT Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2003
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Ukraine
    cPanel Access Level:
    Root Administrator
    yes, I think better to not change this :)

    It seems I find the solution:
    Under the /etc I modified passwd and group files to relate to each other.
    Then I recreate each account.

    I have no much accounts so will do it quickly.

    I even do not want think about if this happen to any other my production box with hundreds of client :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. oderland

    oderland Well-Known Member
    PartnerNOC

    Joined:
    Dec 30, 2002
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Kungsbacka, Sweden
    Help!!!!!!

    We have this problem on 4 production servers, userid is -1 in diffrance to groupid
    Any fix for that? Users is all mixed up!!!

    I've been in contact with cpanel bur no answer in several days!

    Anyone?
     
  7. AlexAT

    AlexAT Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2003
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Ukraine
    cPanel Access Level:
    Root Administrator
    I fixed this manually.
    You need to modify /etc/group and /etc/passwd.
    You can also modify /etc/shadow but it is not very important.

    Modify them carefully (take backup), make each user have own groupID and userID (I used Excel for separate and merge data - VERY helpfull, VERY).
    Then create new account and see what info added - if /etc/passwd and /etc/group contain equal data for IDs then your modification is correct (sometimes it can use old ID's - so I keep creating accounts to make sure all new ID's are syncronized).
    If not - then you can use just added UserID and GroupID to determine where the problem is and fix it again.

    Once this is done you need to manually chmod /home/ACCOUNT files for each affected account and then run /scripts/fixquotas - otherwise your users will have a problem with they sites and quotas.
    Be carefull with chmod'ing - it is not easy to chmod user's home dir (use existing and with correct settings user account for example of chmoding the affected accounts).

    I performed all of this and seems my clients now are happy.
    Most important - I'm happy :)


    Too bad that this happen on different our servers and there were too much accounts to modify by hand.
    I think it's happen because cPanel does not lock all the necessary files during account creating.
    Seems we definitely need a scripts for this.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. oderland

    oderland Well-Known Member
    PartnerNOC

    Joined:
    Dec 30, 2002
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Kungsbacka, Sweden
    oK

    thanks Alexei

    do you know if any changes to passwd files i user/etc dir has to be done?
    I know that we had some problems before with virtual mail accounts/imap
    after changes in /etc/passwd

    Have a nice weekend

    /Jack, Sweden
     
  9. AlexAT

    AlexAT Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2003
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Ukraine
    cPanel Access Level:
    Root Administrator
    I did no such changes.
    All existing, affected and new accounts works fine for a several months.
    So it seems described by me changes are fully enough.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. challii

    challii Well-Known Member

    Joined:
    Feb 3, 2004
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    156
    is it ok for the uid and gid numbers to be different? just they seem to overlap on our servers...

    frluphiu:x:32065:32066::/home/frluphiu:/usr/local/cpanel/bin/jailshell
    gledrlex:x:32066:32067::/home/gledrlex:/usr/local/cpanel/bin/jailshell
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice