Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default CPanel create accounts with wrong GroupID:UserID

    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:


    ac1:x:528:529::/home/ac1:/usr/local/cpanel/bin/noshell
    ac2:x:529:530::/home/ac2:/usr/local/cpanel/bin/noshell
    ac3:x:530:531::/home/ac3:/usr/local/cpanel/bin/noshell
    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
    Regards, Alexey

  2. #2
    Member
    Join Date
    Sep 2001
    Location
    Spain
    Posts
    779

    Default

    WHM -> Server setup -> Minimum Uid
    See also /etc/login.defs or man useradd

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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:
    aaa1com:x:32001:530::/home/aaa1com:/usr/local/cpanel/bin/jailshell
    so - where can I change minimum group ID?
    Regards, Alexey

  4. #4
    Member
    Join Date
    Sep 2001
    Location
    Spain
    Posts
    779

    Default

    Originally posted by AlexAT
    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?
    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.

  5. #5
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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
    Regards, Alexey

  6. #6
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Dec 2002
    Location
    Kungsbacka, Sweden
    Posts
    103

    Unhappy 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. #7
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.
    Regards, Alexey

  8. #8
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Dec 2002
    Location
    Kungsbacka, Sweden
    Posts
    103

    Default 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. #9
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.
    Regards, Alexey

  10. #10
    Member
    Join Date
    Feb 2004
    Posts
    99

    Default

    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

Similar Threads & Tags
Similar threads

  1. WHM accelerated new accounts wrong disk usage and userid
    By karlos in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-16-2009, 05:48 PM
  2. cpanel uses wrong homedirectory for new accounts
    By borki in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 12-23-2007, 10:50 AM
  3. Spam e-mails originating from 'cpanel' userid
    By Arvand in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 11-18-2006, 12:58 PM
  4. /userid /~userid for secure https
    By jdawes in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 12-31-2003, 08:54 PM
  5. userid & duplicate mail account userid@domain
    By Crooner in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-22-2002, 07:34 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube