combine shadow files
I have 5 mail server that will be planning to join as 1. Let's say A,B,C,D and E. The mail server that will act as 1 is A.
My first concern is how do I transfer the user account from B,C,D and E going to A while retaining their password in their previous mail server?
Emails is no concern since I can rsync the home directory.
I'm thinking of combining shadow file but is it advisable? Any software/commands that can do this? Will different OS such as Rh9, FC2 and Centos4 will be an issue even they are all rpm-like OS?
This depends on a lot of things, first of all the mail server itself. Is it the same mail server application on all servers?
Some mail servers allow to set user accounts without the need for a system account. If so, then you don't have to bother with the shadow password files. If the servers run different mail server applications, then you will need a different approach for each.
To merge shadow files you will also have to merge the password files and actually have to create user accounts. You must check for matching username conflicts and also for the more likely conflict of matching UID and GID values.
It can be done with a shell script. Not easy to write, but possible. Needs careful testing before applying.
Fedora HP webcam drivers
The /etc/passwd and /etc/shadow files also contain system users that you don't want to merge.
Here I use these UID ranges to extract the regular users from /etc/passwd:
You would also need to merge both the regular users in /etc/passwd and /etc/shadow.
If you change a users UID you also have to change the UID (ownership) of any files that the user owns, such as the mail in /var/cache/mail/.
If you have a lot of users, you might want to produce a couple of files, similar to /etc/passwd and /etc/shadow, but with extra fields in them. For example, the first field could be the username. The second field the new username. The forth field the UID of the user. The fifth, the new UID of the user. Then read in each line and if an old field differs from a new field, perform any chown on files needed before writing the new values into a new /etc/password or /etc/shadow.
You could use something like this to produce a csv file from /etc/passwd containing the regular users:
|All times are GMT -5. The time now is 03:02 PM.|