That is basically what I have now to see if the user exists, but I can't use
this because I'm using shadow passwords, the only thing that is in position
2 of /etc/passwd is x. So, anyone know of any other ways that I can achieve
this? Thanks for the help though.

Thanks,
Jake


----- Original Message -----
From: "Juan Martinez" <[EMAIL PROTECTED]>
To: "Jake McHenry" <[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 5:18 PM
Subject: Re: Validating passwords via perl, Lil help please!


> Jake,
>
> Here's a script I used while working at a small ISP.  When users forgot
their
> passwords I'd check their guesses with the following script.  Let me
> know if it doesn't makes sense.   I'd be happy to explain.
>
>
> ################################################################
>
> #!/usr/bin/perl
>
> ($#ARGV == 1) || die "Usage: cpw login pwguess\n";
> ($login, $guess) = @ARGV;
>
> ($name, $pass) = getpwnam $login;
>
> if ($name) {
>         if (crypt ($guess, $pass) eq $pass) {
>                 print "Correct\n";
>         }
>         else {
>                 print "Sorry\n";
>         }
> }
> else {
>         print "$login not found in /etc/passwd\n"
> }
>
> ################################################################
>
> --
> Write a wise saying and your name will live forever.
> -- Anonymous
>
> On Thu, 31 Jan 2002, Jake McHenry wrote:
>
> > Date: Thu, 31 Jan 2002 16:10:07 -0500
> > From: Jake McHenry <[EMAIL PROTECTED]>
> > Reply-To: [EMAIL PROTECTED]
> > To: [EMAIL PROTECTED]
> > Subject: Validating passwords via perl, Lil help please!
> >
> > Hello everyone, I'm working on creating a web-based password changer,
but
> > have been having some trouble with the password verification process. I
have
> > verified the the username entered is an acutal user on the system with
> > getpwnam($uname), and that works, but how can I verify that the old
password
> > that they enter is correct? Anything would be greatly appreciated!
> >
> > Thanks,
> > Jake
> >
> >
> >
> >
> > _______________________________________________
> > Redhat-list mailing list
> > [EMAIL PROTECTED]
> > https://listman.redhat.com/mailman/listinfo/redhat-list
> >
>
>
>




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to