Join two accounts: keep emails passwords
I have a special need: merge two cPanel accounts. It's not difficult in general, but my only problem is regarding the email passwords of the original account.
Scenario:
- account1 (old) with about 180 email accounts
- account2 (new) with about 26 email accounts
Goal: to move the emails from account1 to the existing account2. Same server.
In general, I can:
- move the folder /home/account1/mail/domain1.com to somewhere
- delete account1
- create domain1.com as parked in account2
- move the folder domain1.com to /home/account2/mail/
- adjust the owner (chown) of the moved folder
It works, but I lose the passwords of the 180 email accounts, and since they are people in different places and situations, it's impossible to set a new password and inform each one.
So, I need a way to save the file or any other thing where the passwords are stored. I imagine it is a text file, or database, whose passwords are encrypted, but I imagine that just copying this data to the new account should not cause any problems (I believe that the encryption has nothing to do with the original account, correct?)
If you can give me an idea of how to do this, I would be very grateful.
Rogerio
-
I think the passwords are in
/home/CPANELUSERNAME/etc/DOMAIN.TLD/shadowanother file you probably need is
/home/CPANELUSERNAME/etc/DOMAIN.TLD/passwd0 -
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 -
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:
-
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. -
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
.
- Copy the
-
Sync Email Data:
As you mentioned, copy the mail folder (/home/account1/mail/domain1.com
) to/home/account2/mail/
and adjust ownership accordingly. -
Verify Configuration:
- Check
/home/account2/etc/domain1.com/quota
to ensure email quotas are maintained. - Test a few email accounts to confirm login functionality.
- Check
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 -
-
Yeah, I forgot to ask to ChatGPT...
0
Please sign in to leave a comment.
Comments
4 comments