Operating System - HP-UX
1838320 Members
3392 Online
110125 Solutions
New Discussion

migrating users to updated system

 
Mark Vollmers
Esteemed Contributor

migrating users to updated system

Hi, all. Sorry to keep hounding everyone here, but I keep coming up with questions as I'm setting up our system to 11.0 (from 10.20). It's my first system setup (and update, for that matter), and I'm clueless about a bunch of stuff. Anyway, I have the old /etc/passwd and /etc/group files. I thought that simply adding this info to the new /etc/passwd and /etc/group files would restore all the users so I wouldn't have to recreate them. The groups seemed to take, but the users are still not there when I try to log on (I rebooted after modifying the files). I know this should be straightforward. What little detail have I forgotten? Thanks.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
20 REPLIES 20
James R. Ferguson
Acclaimed Contributor

Re: migrating users to updated system

Hi Mark:

Did you create their HOME directories to match their initial working directory (sixth field in /etc/passwd)?

...JRF...
Mark Vollmers
Esteemed Contributor

Re: migrating users to updated system

James-

I want to use the same home directories that were on the old system. these were mounted on our RAID and were not touched during update. That saves me from having to redo .profiles, etc. Can I do this?

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Mark van Hassel
Respected Contributor

Re: migrating users to updated system

HI,

It should be OK on a non-trusted system (check if /tcb existed). Besides the /etc/group and /etc/passwd files you should also copy their home-directories and other user-owned file (check with find / -user [username] on the 10.20 system). A reboot is not necessary.
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
James R. Ferguson
Acclaimed Contributor

Re: migrating users to updated system

Hi Mark:

Sure. That's the value of 'vgimport'.

...JRF...
John Poff
Honored Contributor

Re: migrating users to updated system

Hi Mark,

One thing that has tripped me up before is the users that source scripts from other filesystems in their .profile scripts. Our Oracle DBAs are notorious for that.

Another thing, you're not hounding us. We're here because we love this kind of stuff! Keep asking all those questions, dude. Either we'll help you or we'll learn something (or both).

JP
Sachin Patel
Honored Contributor

Re: migrating users to updated system

Hi Mark,
Can you cd to your home directorys? You says it is on raid box before. did you do your vgimport? By default 11.00 does not put any security.

Sachin
Is photography a hobby or another way to spend $
Mark Vollmers
Esteemed Contributor

Re: migrating users to updated system

Yeah, I can get to them. It's wierd. I can log in as one user, not at all as another, a third is kinda screwed up. None of the users are in the list in SAM, but if I try to add a new user with the same name as was on the old system (like vollmers), it says that that user exists, although it won't list them. Something's not jiving between everything.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Mark van Hassel
Respected Contributor

Re: migrating users to updated system

Hi Mark,

Run a 'pwck'and a 'grpck', what is the output ?
And from 'listusers' ?

Are you sure the system was not trusted ?
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
John Poff
Honored Contributor

Re: migrating users to updated system

Mark,

Check your permissions on /etc/passwd and /etc/group. The Ignite make_recovery usually leaves them with 640 permissions instead of 644.

JP
Patrick Wallek
Honored Contributor

Re: migrating users to updated system

What are the permissions on the /home directory BEFORE you mount it? If the permissions are not entirely correct then you can have some wierd problems.

Do this and see what you see:

umount /home
ll -d /home

If the permissions are not right, change them and then remount /home.

Be sure and do an 'll -d /home' after you remount /home to make sure your permissions there are appropriate for everyone as well.
Mark van Hassel
Respected Contributor

Re: migrating users to updated system

Hi again,

Can you 'su' from root to another user ? ('su [username]' or 'su - [username]')
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
John Poff
Honored Contributor

Re: migrating users to updated system

Oops. On my last post I meant 440 and 444 permissions. They have to be readable by the world.

JP
Mark Vollmers
Esteemed Contributor

Re: migrating users to updated system

Hi, all. The permission are right on the files and I can su to other users. I just took out all the lines I added to /etc/passwd and reentered them (copy) from the old file, and now it appears to work, but the user list in SAM won't update to show the users. I havn't patched the system yet; is that the problem? Or is SAM just dumb?

mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Patrick Wallek
Honored Contributor

Re: migrating users to updated system

Well, David Totsch doesn't call SAM the "Stupid Administrative Module" for nothing! :)

Seriously though, it may depend on the number of users you have on your system. If I go into SAM -> ACCOUNT FOR USERS AND GROUPS -> USERS then I get asked what I want displayed. There is a 500 users limit in SAM now, I have 790 currently defined. The choices that it gives me are: Display range of login names, display range of uids, display single user, display no users.
James R. Ferguson
Acclaimed Contributor

Re: migrating users to updated system

Hi Mark:

You said that when you login as one user it was "kinda screwed up". Exactly what does that mean?

...JRF...
Mark Vollmers
Esteemed Contributor

Re: migrating users to updated system

well, I've backed out entirely and gave it a minute to think and then came logged back in and checked and now it wants to play nive. I guess as long as I can log in it's okay. Thanks for the help, all.

mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Mark Vollmers
Esteemed Contributor

Re: migrating users to updated system

James-

I could log in but the shell was wrong and it complained about something (I don't remember what). I figure that something was wrong when I copied the info the first time.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Magdi KAMAL
Respected Contributor

Re: migrating users to updated system

Hi Mark,

1.When you add users to /etc/passwd, be sure not to duplicate users ( apply it for /etd/group also ).
2. Create all home directories for users and it's respective environments ( .profile, .profile_bash, .login , ...)
3. Install any needed shell for users ( ie. bash id used ).
4. Modify /etc/shells to allow any ftp sessions.

Good luck.

Magdi
James R. Ferguson
Acclaimed Contributor

Re: migrating users to updated system

Hi Mark:

Magdi's suggestions are good ones to heed.

Also (and you may already know and do this): If you create the same user on different servers, follow a strict rule to use the same UID and GID. Remember that Unix "knows" you by number, not name. The /etc/passwd and /etc/group files do the mapping of name-to-number.

Lastly, Patrick's suggestion of unmounting /home, checking its permissions, and those of subordinate directories, was a good one. You *can* have funny permission/access problems on mountpoints that have too strict permissions, and until you unmount you won't be able to see them. Been-there-done-that!

Hope all is now well, regards!

...JRF...
Shannon Petry
Honored Contributor

Re: migrating users to updated system

I like the reference to SAM! I always wonder more about the windows users who think they are Unix Admin's because of it!

For the updating, the easiest thing to do is make a tar archive of the old files, and extract them to the new system after updating. Many pieces of information may not change for years and years. I.E. root having a UID of 0.

Simply before update, do this
tar cvf /tmp/backup.tar /etc/passwd /etc/group /etc/hosts /etc/services /etc/netgroup /etc/mail/aliases

copy the file /tmp/backup.tar to a neutral system till after upgrade, then extract it back with
tar xvf /tmp/backup.tar

Some of the files mentioned you may not have ever touched, but apps may have... Also, this eliminates problems with permissions, etc...

As for UID's on multiple systems, you can use the same password and group file on any system (not /etc/hosts necessarily) as long as the home directories are mounted in the same exact fashion. If there are more than 3 or 4 hosts and your not on the internet, I'd recommend you use NIS. This will eliminate the need to manage multiple passwd and group files, as well as netgroup, aliases, etc...

Regards,
Shannon
Microsoft. When do you want a virus today?