Re: slightly OT::shadow file..

Tim Walberg (twalberg@terabridge.com)
Tue, 16 Nov 1999 11:46:13 -0600


--/qIPZgKzMPM+y5U5
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

On 11/16/1999 12:04 -0500, Arni Raghu wrote:
>> Hi folks,
>> This is slightly OT but I thought only u kernel folks can answer this
>> better::
>>=09
>> Hi,
>> I am just playing with the shadow file (after making copies :) and teh c=
rypt
>> command..
>>=09
>> Here is a simple sequence that I perform..::
>>=09
>> useradd testme
>> passwd testme :: (passwd entered is testme2)
>>=09
>> then look into the shadow file and see::
>>=09
>> testme:$1$hI.ost8u$XZNxiISsD2ZuOrb6/Td3a/:10910:0:99999:7:-1:-1:134537888
>>=09
>> then using a simple perl script..I do $passwd =3D crypyt("testme2","$1");
>>=09
>> But the passwd I get is not the same as the one encoded in teh shadow
>> file...
>>=09
>> what is going on..I thought using the passwd and the salt I should be
>> getting back to the same encrypted passwd..why is this happening..
>>=09
>> something silly..???
>>=09

It's been a while since I've looked at this, but IIRC, the salt in this
case should be "$1$hI.ost8u$", not "$1"... the "$1$" identifies to the
crypt function to use the MD5 algorithm, rather than the DES variant, the
"hI.ost8u" portion is the actual salt, followed by another "$" terminator.
Using a salt string that does not start with "$1$" results in the legacy
DES variant crypt functionality.

I may not have gotten that all right, but it should give you someplace
to start - peruse the libc source for more details...

tw

--=20
+------------------------------+--------------------------+
| Tim Walberg | Phone: 847-782-2472 |
| TERAbridge Technologies Corp | FAX: 847-623-1717 |
| 1375 Tri-State Parkway | twalberg@terabridge.com |
| Gurnee, IL 60031 | 800-SKY-TEL2 PIN 9353299 |
+------------------------------+--------------------------+

--/qIPZgKzMPM+y5U5
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: yC/qS5HcAwkGVZW3lIGES05j2rqjy46h

iQA/AwUBODGYZcPlnI9tqyVmEQIRDACcD9mJCKbGUfSe61I7JZJ6geJLv3UAoMyZ
bDXhVwt9P2nryjnV0y805gLB
=xZYH
-----END PGP SIGNATURE-----

--/qIPZgKzMPM+y5U5--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/