[ale] Linux md5 crypted password files & Solaris8

Michael H. Warfield mhw at wittsend.com
Sun Jul 15 13:47:02 EDT 2001


On Sat, Jul 14, 2001 at 09:58:36PM -0400, Darrell Golliher wrote:

>   I think I'm screwed, but before I give up on this I thought I'd post
> and hope for the best..

>   I want to migrate accounts from a Linux machine to a Sun machine
> without changing any of the account passwords.  My problem is that my
> linux box keeps passwords crypted in MD5 format and my Solaris8 box
> doesn't know what to do with them.

>   My feable knowledge of the crypto involved tells me I'm not going to
> get Linux to convert its shadow file to standard DES.  I had hoped to
> get Solaris8 to use md5 passwords, but so far I can't figure out how
> (of if) that can be done.  My thought was to give pam_unix_so.1 an
> argument of md5, but the man page for pam_unix(5) doesn't say anything
> about it honoring md5.. I tried it anyway, but no workie.

	First a few nits to pick:

	The passwords are not encrypted.  What is stored in the passwd
or shadow files are password hashes.  It's a minor nit, but it helps cut
down on the confusion.  The term "encrypted" implies that the hashes
could be "decrypted" back to their original passwords.  They can not.
They can not, simply because what is there is not an encrypted password,
it's a one-way hash of the password.

	Corollary to that nit is another nit...  Passwords are not
MD5 or DES.  The hashes are.  So "md5 passwords" really should have
been "md5 hashes".

	The confusion over encryption vs hashing originates with the
original use of DES (which is known as an encryption algorithm)
to generate password hashes.  In this case, DES is actually used
as a hashing algorithm by using the password a the key to encrypt
a fixed known value to generate the hash.  MD5 is a hashing algorithm
(but any hashing algorithm can be use to create a crypto system).

	The use of MD5 vs DES and the storage of the hashes in
/etc/shadow or /etc/passwd are also orthogonal to each other.
While I don't know of anyone storing MD5 hashes in /etc/passwd, nothing
really prevents it and you can certainly have mixes of both MD5
hashes and DES hashes in /etc/shadow.  You have to support both MD5
and DES hashes in the same file or it would be next to impossible to
convert between systems.  The "md5" option only indicates what type
of hashes are to be generated when a new password is set.  The PAM module
will use whatever hashes it finds in the file to authenticate the user.

	You are absolutely correct that you can not convert from MD5
hashes to DES hashes (even though that's not what you said, I took it
as what you meant) so your solution is not going to be down that alley.

>   Suggestions anyone?

	The PAM suite originated with Sun and there are some slight
differences between the OpenSource PAM suite and Sun's.  None the less,
it should be possible to "upgrade" PAM on the Solaris box to support
MD5 hashes.  One real BAD gotcha occurs if you are using NIS+, though.
While NIS (no plus) supported arbitrary hashes in the password map,
NIS+ only supports DES hashes.  If you are not using NIS+, however,
you should be able to install a new PAM module that supports MD5 hashes.

	Be REAL careful when you do that, though, and make sure you
keep backup copies of the old PAM modules and don't log out until
you have verified you can log back in and keep that install CD handy,
just in case all else fails.  :-)

> -darrell

	Mike
-- 
 Michael H. Warfield    |  (770) 985-6132   |  mhw at WittsEnd.com
  (The Mad Wizard)      |  (678) 463-0932   |  http://www.wittsend.com/mhw/
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!

--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list