Operating System - HP-UX
1825775 Members
2307 Online
109687 Solutions
New Discussion

Preserves user password during migration

 
Ngoh Chean Siung
Super Advisor

Preserves user password during migration

Hi,

I hv created an user account with login name as ncs in server A. Actually I want to migrate this user id from server B to server A. In order to preserve the user password at server B, I hv copied the ncs file from server B /tcb/files/auth/n to server A. I don't copy the entry from /etc/passwd from server B to server A. I able to login but the user id(UID) is diff between /etc/passwd & /tcb/files/auth/n

Below is the diff for /tcb/files/auth/n/ncs between 2 servers
server A:
ncs:u_name=ncs:u_id#129:\
:u_pwd=P6RuJxtEmE8Sg1DIt0VDIoi.jc2OgNv2Zf6:\
:u_auditid#386:\
:u_auditflag#1:\
:u_succhg#1139966489:u_unsucchg#1128497238:u_pswduser=ncs:u_suclog#1142
501475:\
:u_suctty=pts/to:u_unsuclog#1142407526:u_unsuctty=pts/t1:u_lock@:\
:chkent:

server B:
ncs:u_name=ncs:u_id#138:\
:u_pwd=AGTGLLXIP8mWA:\
:u_auditid#277:\
:u_auditflag#1:\
:u_succhg#1142501503:u_unsucchg#1141980009:u_suclog#1142501536:u_suctty
=pts/tO:\
:u_unsuclog#1142501488:u_unsuctty=pts/tO:u_lock@:chkent:

Questions:
1) Any impact that I just copy /tcb/files/auth/n/ncs only without /etc/passwd?

2) Due to I already create user account called ncs in server A, any impact if I copy ncs entry from server B /etc/passwd and overwrite it at server A?

3) I hv created 80 users in server A. If I need to copy 80 users entries from /etc/passwd and /tcb/files/auth, what is the easiest and fastest way?

regards.
7 REPLIES 7
Muthukumar_5
Honored Contributor

Re: Preserves user password during migration

1) Any impact that I just copy /tcb/files/auth/n/ncs only without /etc/passwd?

Problem will come when you are converting your machine to non-trusted mode. Copy /etc/passwd and /tcb/ directory as well.

2) Due to I already create user account called ncs in server A, any impact if I copy ncs entry from server B /etc/passwd and overwrite it at server A?

Password and user setting will be changed as like Server B. Hope you can select fields from server B's /etc/passwd and update into Server A.

3) I hv created 80 users in server A. If I need to copy 80 users entries from /etc/passwd and /tcb/files/auth, what is the easiest and fastest way?

Just transfer the file from Server B to Server A with some other extensions. Take the backup of already existing (It is needed). Try to update it with cp -p mode.

--
Muthu
Easy to suggest when don't know about the problem!
Ngoh Chean Siung
Super Advisor

Re: Preserves user password during migration

Hi,

1) Normally for users account migration, do we need to manually create the users account in destination server first and then copy the /etc/passwd and /tcb/files/auth?

2) In server A, I already hv a list of existing users account at /etc/passwd. What I can think off is append 80 users entries from server B to server A bcos I cannot overwrite existing server A /etc/passwd. Is it what I suppose to do?

3) For /tcb/files/auth, normally what is the method that used to overwrite? What I can think off is backup /tcb/files/auth using tar at server B and restore it into server B. But I afraid the restoration will affect others users such as users passwd file corrupted. Any good suggestion?

regards.
Muthukumar_5
Honored Contributor

Re: Preserves user password during migration

1) Normally for users account migration, do we need to manually create the users account in destination server first and then copy the /etc/passwd and /tcb/files/auth?

If you copy /etc/passwd file entries to Server A then users are added as well.

2) In server A, I already hv a list of existing users account at /etc/passwd. What I can think off is append 80 users entries from server B to server A bcos I cannot overwrite existing server A /etc/passwd. Is it what I suppose to do?

User accounts has to be unique. Don't add duplicate entries. Try to run pwck after migration to check for errors. See man pwck.

3) For /tcb/files/auth, normally what is the method that used to overwrite? What I can think off is backup /tcb/files/auth using tar at server B and restore it into server B. But I afraid the restoration will affect others users such as users passwd file corrupted. Any good suggestion?

May be you can copy and paste /tcb/files/auth directory files except root user. That is useful. More then try to backup existing /tcb/ directory before making any trial.

--
Muthu
Easy to suggest when don't know about the problem!
Ngoh Chean Siung
Super Advisor

Re: Preserves user password during migration

Hi,

Do you mean that after copy the /etc/passwd, users home directory will be automatically created? Need to restart services or reboot server for the automatically users home directory creation?

regards.
Ngoh Chean Siung
Super Advisor

Re: Preserves user password during migration

Hi,

How about the users group is diff? Let said at server B, the user group for these 80 users is users. But at server A, I want the user group for these 80 users as test.

Pls advise.

regards.
Arunvijai_4
Honored Contributor

Re: Preserves user password during migration

Hello,

How about the users group is diff? Let said at server B, the user group for these 80 users is users. But at server A, I want the user group for these 80 users as test.

You need to migrate the groups as well. That is, you may need to add users to other group.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Ngoh Chean Siung
Super Advisor

Re: Preserves user password during migration

Hi,

I already manually created 80 users with grp id 123 in server A. Assumed that the grp id for these users in server B is 150.

Q1) After I copy these 80 users entries at /etc/passwd from server B to server A, can I just replace these users grp id with 123?

Q2) Is the content under /tcb/files/auth include the grp id info? As I know, it seems doesn't include.

regards.