Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving users 1

Status
Not open for further replies.

Nostradamus

Technical User
May 3, 2000
419
SE
I (a friend of mine actually) have a problem.

In the near future, users from 22 different "servers" are beeing transferred from AIX 3-4.
The old (5-8 years?) machines are beeing merged into a new IBM 6H1 Server with AIX 4.3(?)

There's a huge possibility that duplicate username will appear. That must be kept in mind.

I used a command on SCO Openserver to export all users and import into a new machine. There must be an equivalent in AIX.

How would I (my friend) go about this business?

thanks in advance. /Sören
 
This could be more complicated than just having duplicate user names. It is the user id number which is more important. If you have duplicate uids then users will be able access other users files. For example you could have two users with different login names, but identical uid's. They would have full access to each others files.

I don't know of a tool to do this for you, but I would think about giving each user a new unique name and uid, then copying the contents of their old home directories into their new ones.

After many years, user accounts can get quite messy, and the migration to a new server presents an opportunity to have a clean start.
 
I've thought of the idea about a clean start. Ripping all uid, usernames and homedirectories and recreate them all.
But there are perhaps 1500+ users on the 22 machines.
Don't know if I've time for that.

It was the duplicate uid question I hoped to get an answer for.
The only place where uid is used to set permissions are the home directories.
What I'm looking for is a tool that will give each user a new uid and username as well as change the permissions set on homedirectories.
If the tool runs into a duplicate (either username or uid) change one of them, set new permissions and move on.

Hope you understand what I mean (and that the above scenario is possible) /Sören
 
Check out this document


Going from 3.2 to 4 is harder since there are new users created that take reserved uids.... You could probably write a script to merge some of the fields..or check for dups....before you try to move it.......but maybe the document will give you some clue.


AIX requires certain user and group definitions to remain unchanged. Verify that your /etc/passwd has entries matching the following:

root:!:0:0::/:/bin/ksh
deamon:!:1:1::/etc:
bin:!:2:2::/bin:
sys:!:3:3::/usr/sys:
adm:!:4:4::/var/adm:
uucp:!:5:5::/usr/lib/uucp:
guest:!:100:100::/home/guest:
nobody:!:4294967294:4294967294::/:

On version 3.2 systems, the adm group will appear as follows:

adm:!:4:4::/usr/adm:

It is important to verify that the preceding entries exist and match exactly. Also,
verify that no other user has UIDs that duplicate the preceding. The UID is
the third colon-separated entry, the first number.

Verify that your /etc/group file has entries matching the following:

system:!:0:root
staff:!:1:
bin:!:2:root,bin
sys:!:3:root,bin,sys
adm:!:4:bin,adm
uucp:!:5:uucp
mail:!:6:
security:!:7:root
cron:!:8:root
printq:!:9:
audit:!:10:root
ecs:!:28:
nobody:!:4294967294:nobody
usr:!:100:guest

Check that the preceding entries exist. It is acceptable to have more
users in the group, for instance, the system entry can look like
system:!:0:root,james,eddie,rocky,david, but verify that
the GIDs are unique and that the users are in the preceding groups.
GIDs are the third colon-separated entry, the first number.

Make sure all of the user definitions are correct in the user database:

#usrck -n ALL

Do the same for the groups:

#grpck -n ALL

If you find errors, correct them by replacing the -n flag with the -t flag.
(BE CAREFUL with this...some say if it was screwed up, you may have to rework stuff so have a backup first)

WARNING: AIX checks the users and groups based on standard
UNIX user and group expectations. Your environment or application
may require groups and users that deviate from standard UNIX
users and groups. If you are not sure, it's best to leave it the same!
 
Your best bet would be to write a script to do this. Copy all the /etc/passwd & group files from all the source machines into a temp area and write to read the users / uids / group etc and recreate on the new server.

You should easily be able to add logic to check for duplications .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top