another option. i use ftp. configure vsftpd to timeout in one second
(for security). the advantage is you can try to authenticate with
another server.
function tryaccount_ftp ($user, $password, $server = "localhost") {
$ret = 0;
$conn_id = ftp_connect ("$server");
$lr = ftp_login ($conn_id, "$user", "$password");
if ((!$conn_id) || (!$lr)) {
$ret = 0;
} else {
$ret = 1;
}
ftp_quit ($conn_id);
return $ret;
}
On Fri, 18 Feb 2005 19:52:15 +0800 (SGT), Rowel Atienza
<[EMAIL PROTECTED]> wrote:
>
> On Thu, 17 Feb 2005, Henry Ortega wrote:
>
> > Is there a way to pass the password as a parameter
> > to /bin/login?
> >
> > Or is there any other command I can use to verify
> > if a certain username/password pair is valid?
>
> In perl:
>
> #!/usr/bin/perl
>
> use strict;
> my $pwd = (getpwuid(getpwnam($ARGV[0])))[1];
> if (crypt($ARGV[1], $pwd) ne $pwd) {
> print "User/password invalid\n";
> } else {
> print "User/password ok\n";
> }
>
> arguments (username passwd) supplied on the command line. change this
> depending on your source.
>
> rowel
>
> --
> Philippine Linux Users' Group (PLUG) Mailing List
> [email protected] (#PLUG @ irc.free.net.ph)
> Official Website: http://plug.linux.org.ph
> Searchable Archives: http://marc.free.net.ph
> .
> To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
> .
> Are you a Linux newbie? To join the newbie list, go to
> http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie
>
--
Seek ye first the kingdom of God and all these things shall be added unto you.
Winelfred G. Pasamba
Adventist University of the Philippines
Computer Science Department, AUP Online Information System
--
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie