LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-07-2004, 02:17 PM   #1
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Rep: Reputation: 30
Question Password Migration


I have an old mail-server running RH 7.2. I have built a new mail-server running RH 9. I need to migrate my user's accounts and passwords over to this new machine.

I am not certain what encryption mechanism my 7.2 server was using as my system-auth file found in /etc/pam.d/ dir looks like this:

# User changes will be destroyed the next time authconfig is run.
auth required /lib/security/pam_env.so
auth sufficient /lib/security/pam_unix.so likeauth nullok
auth required /lib/security/pam_deny.so

account required /lib/security/pam_unix.so

password required /lib/security/pam_cracklib.so retry=3 type=
password sufficient /lib/security/pam_unix.so nullok use_authtok shadow nis
password required /lib/security/pam_deny.so

session required /lib/security/pam_limits.so
session required /lib/security/pam_unix.so

The one from my 9 server looks like so:

# User changes will be destroyed the next time authconfig is run.
auth required /lib/security/$ISA/pam_env.so
auth sufficient /lib/security/$ISA/pam_unix.so likeauth nullok
auth required /lib/security/$ISA/pam_deny.so

account required /lib/security/$ISA/pam_unix.so

password required /lib/security/$ISA/pam_cracklib.so retry=3 type=
password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password required /lib/security/$ISA/pam_deny.so

session required /lib/security/$ISA/pam_limits.so
session required /lib/security/$ISA/pam_unix.so

My assumption is that both machines are making use of md5 sums with respect to their shadow files. Unfortunately, when I compare two already exisiting users on both machines, their password hashs are not identical.

So...

My questions to you are:

1. What would be the best way to figure out what encryption mechanism my old server is using?
2. What would be the best way to migrate my user's passwords from one machine to the other?

Thanks...
 
Old 10-07-2004, 03:02 PM   #2
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 15;
Posts: 440

Rep: Reputation: 46
I think you are looking at the wrong place. Pam is the mechanism that is used when logging into the system. (It stands for pluggable authenication modules.) The passwords stored in the /etc/shadow directory use a crypt utility to encrypt the password. The first two bytes of the password are called the 'salt'. These bytes are a random number used in the encryption phase. In Unix, or Linux, if two users enter the same password they are likely to appear different in the shadow file because of the 'salt'. I think under windows, at least until NT4, two passwords would always be encrypted the same. I think if you would copy the password and the shadow file, you will probably okay. Make sure you save the original files in case things get screwed up
 
Old 10-08-2004, 07:04 AM   #3
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
ya know, if ya copy the shadow line from one machine to another the same password is good.

In favt the useradd command has an option -p for that, although just copying the line is easier.
 
Old 10-08-2004, 09:53 AM   #4
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Original Poster
Rep: Reputation: 30
ugh...
 
Old 10-09-2004, 10:13 AM   #5
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
Red Hat have been using MD5 as the default for a very long time (since RH 7, possibly).

At work we migrated between mail servers once by copying the /etc/passwd, /etc/shadow and /etc/group files from an old (Sun) machine to a newer (RH) system.

The main issue is that the listings for the built-in system accounts have to be correct for the new system or things may break. So I took copies of the files from the new machine and added the lines for the relevent user accounts from the files on the old machine. I actually used the Gnumeric spreadsheet software for this.

Provided that the three authentication files are consistent you can then copy them into place on the new system. Since this won't terminate existing logins it's a good idea to be logged in as root on a console before you start in case you make a mistake.

Once the files were replaced we used a script to create the home directories for the accounts on the new box, copied the mailboxes over and used another script to reset the permissions on the mailboxes.
 
Old 10-09-2004, 07:18 PM   #6
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
Moving this, moving that, Yep it is a pain, Now ya know why a lot of admin's like the user's home directories and /var/spool/mail mounted as either nfs, sfs or smb shares. With the mail, the user's always have their mail despite what machine they are working on.
 
Old 10-10-2004, 04:32 AM   #7
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
In our case, the problem was that we were migrating the central server that was holding the user mail for the whole network, as WeNdeL is doing.

On average I think that a server runs for about 4 or 5 years before you have to migrate the services to a new one for one reason or another. UNIX makes it easy and stress free - copy a few files, reset the permissions, restart the services. Migrating services between Windows systems is usually a horrible experience.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Migration osiris69 Linux - General 4 03-27-2005 08:41 PM
migration #1 - versions... jazzben Linux - Software 7 08-15-2004 05:48 PM
How can I change e-mail password(or linux account password) with php in website?? yusuf Programming 1 05-28-2004 09:39 AM
migration away from qmail Deltron3030 Linux - General 1 02-17-2004 04:01 PM
Migration digimak Slackware 2 10-06-2003 12:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration