Re: perl and md5 crypt

2002-01-18 Thread Rob Weir
On Mon, Jan 14, 2002 at 05:26:36AM +0100, Christian Jaeger wrote: > At 2:04 Uhr +0100 14.01.2002, Dries Kimpe wrote: > >Wouldn't it be easier (and more portable) to just use > >the passwd program to set the password? > >As you script has to run as root anyway it won't ask > >for the old password, a

Re: perl and md5 crypt

2002-01-13 Thread Christian Jaeger
At 2:04 Uhr +0100 14.01.2002, Dries Kimpe wrote: Wouldn't it be easier (and more portable) to just use the passwd program to set the password? As you script has to run as root anyway it won't ask for the old password, and you could just write the password that you want to a pipe (as stdin for pas

Re: perl and md5 crypt

2002-01-13 Thread john
Brian Clark wrote: > * john ([EMAIL PROTECTED]) [Jan 13. 2002 21:51]: > > > > > Isnt that how the man page says to do it? > > > > Which man page? > > > man 3 crypt > > Ah, I took your statement to mean some perldoc stated "this is how > you generate md5 passwords with perl." > > Thedore might need

Re: perl and md5 crypt

2002-01-13 Thread Brian Clark
* john ([EMAIL PROTECTED]) [Jan 13. 2002 21:51]: > > > Isnt that how the man page says to do it? > > Which man page? > man 3 crypt Ah, I took your statement to mean some perldoc stated "this is how you generate md5 passwords with perl." Thedore might need to install manpages-dev in that case.

Re: perl and md5 crypt

2002-01-13 Thread john
Brian Clark wrote: > * john ([EMAIL PROTECTED]) [Jan 13. 2002 21:10]: > > > Brian Clark wrote: > > [...] > > > > ---[ perl ] > > > > for(0 .. 7) { > > > $salt .= join '', ('.', '/', 0..9,'A'..'Z', 'a'..'z')[rand 64]; > > > } > > > > $password = crypt($password,'$1$' . $salt . '$');

Re: perl and md5 crypt

2002-01-13 Thread Brian Clark
* john ([EMAIL PROTECTED]) [Jan 13. 2002 21:10]: > Brian Clark wrote: [...] > > ---[ perl ] > > for(0 .. 7) { > > $salt .= join '', ('.', '/', 0..9,'A'..'Z', 'a'..'z')[rand 64]; > > } > > $password = crypt($password,'$1$' . $salt . '$'); > > > > I *thi

Re: perl and md5 crypt

2002-01-13 Thread john
Brian Clark wrote: > * Thedore Knab ([EMAIL PROTECTED]) [Jan 13. 2002 19:57]: > > > How would I fix this to generate MD5 passwords ? > > [...] > > > It should look like this MD5 style: > > tester3:$1$sx6dzguz$IyKiUC3Ua2MCOFDZxppzk1:11701:0:9:7::: > > Try this: > > ---[ perl ] > >

Re: perl and md5 crypt

2002-01-13 Thread Brian Clark
* Thedore Knab ([EMAIL PROTECTED]) [Jan 13. 2002 19:57]: > How would I fix this to generate MD5 passwords ? [...] > It should look like this MD5 style: > tester3:$1$sx6dzguz$IyKiUC3Ua2MCOFDZxppzk1:11701:0:9:7::: Try this: ---[ perl ] for(0 .. 7) { $salt .= join '', ('.', '/

Re: perl and md5 crypt

2002-01-13 Thread Dries Kimpe
On Sun, 13 Jan 2002, Thedore Knab wrote: > How would I fix this to generate MD5 passwords ? > Wouldn't it be easier (and more portable) to just use the passwd program to set the password? As you script has to run as root anyway it won't ask for the old password, and you could just write the pas

perl and md5 crypt

2002-01-13 Thread Thedore Knab
How would I fix this to generate MD5 passwords ? I am writing a tiny script that creates student users and assigns the passwords, sets permissions to chmod 711, sets up user fetchmail, setups the muttrc, and setups a generic signiture, and a generic web-site. I am stumped on the, borrowed, cyrpt