GreenLake Administration
Operating System - HP-UX
1845515
Members
2689
Online
110244
Solutions
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
Forums
Categories
This widget could not be displayed.
Company
This widget could not be displayed.
Local Language
This widget could not be displayed.
back
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
back
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
Blogs
Information
This widget could not be displayed.
This widget could not be displayed.
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2006 03:47 AM
06-27-2006 03:47 AM
PAM
Hi all,
I need to checkout if a given user is a valid user by PAM.
I have faced that I can only check this out with root permissions, but I don't want to run Apache with root permissions. There's any way to change this to allow an other user to do this?
I'm using a HP-UX 11.11 PA-RISC 2.0
I'm using this small script to test this:
======
#!/opt/perl/bin/perl
use Authen::PAM;
$service = "php";
$username = $ARGV[0];
$password = $ARGV[1];
print "Usage: \n" if ( $ARGV[0] eq "" );
sub my_conv_func
{
my @res;
while ( @_ )
{
my $code = shift;
my $msg = shift;
my $ans = "";
$ans = $username if ($code == PAM_PROMPT_ECHO_ON() );
$ans = $password if ($code == PAM_PROMPT_ECHO_OFF() );
push @res, (PAM_SUCCESS(),$ans);
}
push @res, PAM_SUCCESS();
return @res;
}
ref($pamh = new Authen::PAM($service, $username, \&my_conv_func)) ||
die "Error code $pamh during PAM init!";
$res = $pamh->pam_authenticate;
if ( $res == PAM_SUCCESS() )
{
print "Password OK!\n";
}
else
{
print "Password incorrect!\n";
print $pamh->pam_strerror($res)."\n";
}
I need to checkout if a given user is a valid user by PAM.
I have faced that I can only check this out with root permissions, but I don't want to run Apache with root permissions. There's any way to change this to allow an other user to do this?
I'm using a HP-UX 11.11 PA-RISC 2.0
I'm using this small script to test this:
======
#!/opt/perl/bin/perl
use Authen::PAM;
$service = "php";
$username = $ARGV[0];
$password = $ARGV[1];
print "Usage:
sub my_conv_func
{
my @res;
while ( @_ )
{
my $code = shift;
my $msg = shift;
my $ans = "";
$ans = $username if ($code == PAM_PROMPT_ECHO_ON() );
$ans = $password if ($code == PAM_PROMPT_ECHO_OFF() );
push @res, (PAM_SUCCESS(),$ans);
}
push @res, PAM_SUCCESS();
return @res;
}
ref($pamh = new Authen::PAM($service, $username, \&my_conv_func)) ||
die "Error code $pamh during PAM init!";
$res = $pamh->pam_authenticate;
if ( $res == PAM_SUCCESS() )
{
print "Password OK!\n";
}
else
{
print "Password incorrect!\n";
print $pamh->pam_strerror($res)."\n";
}
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2006 07:51 AM
06-27-2006 07:51 AM
Re: PAM
Have you tried setting the SUID bit to the script? Considered also the use of sudo for this script only?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2006 06:20 PM
06-27-2006 06:20 PM
Re: PAM
Yes, but this script is just for testing purpouses.
Since something like this script will be a PHP module, the suid bit takes no efect.
There is any other way to give enought permissions to run this without runing apache as root (or setting the suid bit)?
thank you all
Since something like this script will be a PHP module, the suid bit takes no efect.
There is any other way to give enought permissions to run this without runing apache as root (or setting the suid bit)?
thank you all
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP