[TriLUG] back on topic... MD5 passwords for adding users ?

jeremyp at pobox.com jeremyp at pobox.com
Fri Sep 7 16:54:50 EDT 2001


Hi all,

I'm looking to find some documentation on how MD5 passwords work in
Linux.  Specifically, I'm trying to write a perl script to add
users, with passwords that I generate.  I figured the easiest way to do
this is to feed stuff to "useradd", and let useradd do the dirty work, but
useradd will only take encrypted passwords.  Its man page says this:

       -p passwd
              The  encrypted password, as returned by crypt(3) or
              an MD5 password generator.  The default is to  dis-
              able the account.

I need the "MD5 password generator" that it's referring to!  I've seen
some comments that crypt(3) in Linux can handle MD5 passwords, but
there is no documentation in "man 3 crypt" on this, and I feel I'd be
reinventing the wheel anyway to write a C program to do this.

I've googled quite a bit and can't find anything useful ... thanks for any
insight!

Regards,

Jeremy Portzer
Durham Technical Community College




More information about the TriLUG mailing list