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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

All e-mail accounts have the same UID in passwd file

Discussion in 'E-mail Discussions' started by gramzon, Dec 4, 2017.

  1. gramzon

    gramzon Registered

    Joined:
    Dec 4, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Croatia
    cPanel Access Level:
    Root Administrator
    I have recently migrated all e-mail accounts by manually copying the "/etc/(domain)" and "/mail/(domain)" folders to a new server.

    1. Upon inspection of the "passwd" file in "/etc/(domain)" I have noticed that all of the transferred accounts have the same UID:GUID (636:634) and that all of the accounts I created after the migration to the new server ("cPanel->Email Accounts->Create Account") also have the same UID:GUID(1004:1006). Is this intended behavior or should all accounts have a different UID? If this is intended, should I change the UID:GUID of the transferred accounts to 1004:1006 as well?

    2. The transferred accounts all have this path to the shell "/usr/local/cpanel/bin/noshell" while the accounts I created on the new server have this path "home/(user)". Where can I set the default option to "/usr/local/cpanel/bin/noshell" for newly created accounts?

    This is an example of a transferred account:
    username:x:636:634::/home/(user)/mail/domain/username:/usr/local/cpanel/bin/noshell

    This is an example of a newly created account:
    username:x:1004:1006::/home/(user)/mail/domain/username:/home/(user)

    I should note that everything appears to be working after the e-mail migration. I am sorry if this is in the wrong subforum.
     
  2. gramzon

    gramzon Registered

    Joined:
    Dec 4, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Croatia
    cPanel Access Level:
    Root Administrator
    I figured out #1
    The e-mail accounts are all created with the UID:GID of the main user located in root "etc/passwd"
    I changed the UID:GID of the old e-mail accounts that were transferred to reflect the respective user on the new server.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,763
    Likes Received:
    1,710
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm glad to see you were able to solve your email account UID issue. As for your other question:

    You can disable shell access in a package (WHM >> Add a Package) and ensure to use packages when creating new accounts. Or, when creating an account without a package via WHM, choose "Select Options Manually", and ensure "Shell Access" is disabled.

    For existing accounts, you can use "WHM >> Manage Shell Access" to set an account to "Jailed Shell", and then back to "Disabled Shell" if you need to reset the /etc/passwd entries that you manually copied.

    Thank you.
     
Loading...

Share This Page