Operating System - HP-UX
1834596 Members
3665 Online
110069 Solutions
New Discussion

Re: Copying /etc/passwd from old system to new system

 
SOLVED
Go to solution
Brad Marks
Super Advisor

Copying /etc/passwd from old system to new system

I am planning a migration from a K-420 to a rp5470. What, if any, are the caveats in simply copying /etc/passwd from the old system to the new?
My main concern is the generation of a new users' user-id: Where does the system get the next number to use? Does it validate that it doesn't already exist in passwd when assigning a new one?
TIA,
Brad
It's not impossible -- it'll just cost more...
10 REPLIES 10
Rodney Hills
Honored Contributor

Re: Copying /etc/passwd from old system to new system

Should be ok. Make sure any entries that are in the rp5470 /etc/passwd and not in your K420 are created. Could be an account required by the OS or supporting system.

HTH

-- Rod Hills
There be dragons...
Michael Tully
Honored Contributor

Re: Copying /etc/passwd from old system to new system

Usually we would implement a change control procedure of "No more accounts to be added or changed"
After you have copied the /etc/passwd file across to the new system, create a new password file for your old system, so no one logs in except those that need to. You can always run a 'diff' between the two files. The allocation of uid numbers can be done manually, if you use 'useradd' from the command line or SAM will pick the next available number. If using 'useradd' you will get an error message that that uid has been used. Just make sure that you don't have your system set up as trusted. (slightly different procedure)
Anyone for a Mutiny ?
Brad Marks
Super Advisor

Re: Copying /etc/passwd from old system to new system

Michael,
Do you know where SAM gets the next available number?
Just curious.
Thanks to both of you for your help.
Brad
It's not impossible -- it'll just cost more...
T G Manikandan
Honored Contributor

Re: Copying /etc/passwd from old system to new system

To my knowledge,

Sometime before SAM was programmed such a way that it will used a unused uid above 100.

I am not sure whether any changes have been done recently on this.
T G Manikandan
Honored Contributor
Solution

Re: Copying /etc/passwd from old system to new system

Also,

when you copy the /etc/passwd & /etc/group file make sure you have a session opened by root.
Once you copy it,change the password of root immediately and try logging into root opening a new session.

"keep one session of root open until things work successfully"
T G Manikandan
Honored Contributor

Re: Copying /etc/passwd from old system to new system

Just check with SAM,you can create user templates and there you can define how the UID should be assigned.you can customize the uid assignment for user creation.

SAM-->users-->actions-->user templates--
Elmar P. Kolkman
Honored Contributor

Re: Copying /etc/passwd from old system to new system

Possible caveats:
- nonexisting shells
- nonexisting homedirs
- change in encryption method

So, after copying your passwd and group file, run the pwck and grpck utilities and replace the root-line from the old passwd file back to the new one, to make sure root still can login. Check that one too. And take a look at differences between the two files for pseudo users defined on the new machine before copying the passwd file. It might be the new installation has some extra pseudo users defined you didn't have. It might even be you get into trouble with old users having user id's that have extra rights now, for instance a normal user that has the same uid as the http users on the new system....
Every problem has at least one solution. Only some solutions are harder to find.
Suresh Patoria
Super Advisor

Re: Copying /etc/passwd from old system to new system

Hi,

It should be OK. but also u need to copy /etc/group and home directory of all users

Thanx
Karthik S S
Honored Contributor

Re: Copying /etc/passwd from old system to new system

After copying these files run pwck and grpck to find if there are any inconsistencies.

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Hoefnix
Honored Contributor

Re: Copying /etc/passwd from old system to new system