United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Account Links: Cart Your Account Logout
Migrating user accounts is not an easy task. You would have to make sure that file ownerships remain intact and passwords and group memberships remain the same. Files to consider would be, for example, their home directories and emails.
The good thing with Red Hat Enterprise Linux 2.1 and 3 is that they have similarities with the way they handle user accounts. Users that are added to the system always start with UID and GID values of 500 and up unless overriden (see man page for useradd). Here, we are assuming that you are using /etc/passwd, /etc/group and /etc/shadow for authentication. Migrating then, is a matter of importing user accounts with UID >= 500.
In order for this procedure to work properly, you should not create any new user accounts on the newly installed Red Hat Enterprise Linux 3 system. The process below involves taking your user accounts and appending them to existing system accounts in the appropriate files. This procedure is only valid for post installation and we recommend that you back up any files that you will be appending user account information to.
On the Red Hat Enterprise Linux 2.1 system:
# awk -F: '($3>=500) && ($3!=65534)' /etc/passwd > passwd.txt
# awk -F: '($3>=500) && ($3!=65534)' /etc/group > group.txt
# awk -F: '($3>=500) && ($3!=65534) {print $1}'
/etc/passwd|tee -|egrep -f - /etc/shadow > shadow.txt
# tar czpf home.tgz /home
# tar czpf mail.tgz /var/spool/mail
|
Copy the files passwd.txt, group.txt, shadow.txt, home.tgz, and mail.tgz and put them in, say, /backup on the Red Hat Enterprise Linux 3 system then do the following:
# cd / # cp /etc/passwd /backup/passwd-backup.txt # cat /backup/passwd.txt >> /etc/passwd # cp /etc/group /backup/group-backup.txt # cat /backup/group.txt >> /etc/group # cp /etc/shadow /backup/shadow-backup.txt # cat /backup/shadow.txt >> /etc/shadow # tar zxf /backup/home.tgz # tar zxf /backup/mail.tgz |
Check if the migration was successful by logging into the system using one of the migrated user's account.