Skip to main content

Join two accounts: keep emails passwords

Comments

4 comments

  • quietFinn

    I think the passwords are in
    /home/CPANELUSERNAME/etc/DOMAIN.TLD/shadow

    another file you probably need is
    /home/CPANELUSERNAME/etc/DOMAIN.TLD/passwd

     

    0
  • Rogerio Vitiello

    Yes, thanks, that's a start.

    The "shadow" file, each user is in the format:

    <user>:<cripto-password>:<number?>::::::

    What is this "number"?

    The "passwd" seems to be related to ssh/terminal, which we don't use:

    <user>:x:<userid>:<groupid>::<user mail path>:<account root path>

    But, I have no way to test...

    Does anyone know if just copying these lines is enough to recreate the email accounts directly, without using whmapi/cpanel?

    0
  • Fahad Raza

    Hi Rogerio,

    To retain email passwords when merging two cPanel accounts, you’ll need to transfer the password hashes along with the email data. Here’s how you can handle it:

    1. Locate Email Passwords:
      The email account passwords are stored in the /home/account1/etc/domain1.com/passwd file. This file contains the usernames and password hashes.

    2. Transfer the Password File:

      • Copy the passwd file from /home/account1/etc/domain1.com/ to /home/account2/etc/domain1.com/.
      • Ensure the ownership of the transferred file matches account2 using chown.
    3. Sync Email Data:
      As you mentioned, copy the mail folder (/home/account1/mail/domain1.com) to /home/account2/mail/ and adjust ownership accordingly.

    4. Verify Configuration:

      • Check /home/account2/etc/domain1.com/quota to ensure email quotas are maintained.
      • Test a few email accounts to confirm login functionality.

    This approach preserves passwords without requiring users to reset them. Let me know if you need further details!

    If you still have any confusion, feel free to ask 

    0
  • Rogerio Vitiello

    Yeah, I forgot to ask to ChatGPT...

    0

Please sign in to leave a comment.