Moving from HP-UX to RHEL6 - /etc/passwd
Hi,
I've searched and not found anything like this. I have more than 1,000 users in my HP-UX /etc/passwd file. Are there any means of moving usernames and passwords to my new Red Hat box? My concern is the UID; I think the rest of the HP-UX entry could be utilized. Thanks, Brad |
Suggestion -
If you really have 1000+ users (or even 20+ users), then why not use a directory service (instead of /etc/passwd)? If your organization already has a directory service, this might be a great time to integrate it with Red Hat. Plan B would be to write a simple shell script that: 1. Parses your old /etc/passwd (in a loop) 2. Adds all needed groups first 3. Does the appropriate "useradd" for each user (including hard-coded UID, if it's important to you) |
Thanks, Paul, I appreciate your response.
Unfortunately this is a legacy system from the 80's, and for reasons particular to the language we run under Linux, using a directory service is not appropriate. Meanwhile, what about the user ID? Do they simply have to be unique within passwd, or is there a dependency in some other OS file/database? Regards, Brad |
Hello Brad,
First create tar ball of old users in your old system. Create a directory: Quote:
Quote:
Quote:
Now you should also create backup of /home and /var/spool/mail dirs: Quote:
Now on new Linux machine, first, make a backup of current users and passwords: Quote:
Quote:
Now copy and extract home.tar.gz to new server /home : Quote:
And at last now reboot the new machine. Hope it should work for you and let us know the results... |
Now as per your UID's concern, in RHEL default is 500 and upper limit is 65534 and check /etc/libuser.conf file for UID values.
And in Debian and Ubuntu, default is 1000 and upper limit is 29999. |
Wow!
Satyaveer,
Incredibly helpful. Many thanks. My HP-UX system is so old, the user ID #s are all over the place (from 108 to 1295!). Not 500 and up like in Linux. The nice thing is that all users belong to a single group # so I can parse them out by tweaking the instructions you supplied. Then, once on the new system, I will write a script that will re-assign UIDs starting at 510 (we already created 9 new users) and increment after each change. It will probably be a while, but I will definitely let you know how it goes. Thank you, Brad |
Hello Brad,
Well, thanks thanks for appreciating. Now, if your problem has been solved then you can mark your thread as solved and if you find post helpful you can give your feedback and reputation. |
All times are GMT -5. The time now is 08:36 AM. |