Operating System - HP-UX
1752801
Members
5439
Online
108789
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
- 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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP