Operating System - HP-UX
1829812 Members
1716 Online
109993 Solutions
New Discussion

use 'login' to authenticate a userid/password?

 
SOLVED
Go to solution
RobertCarback
Frequent Advisor

use 'login' to authenticate a userid/password?

How can I authenticate a user's login/password while they are logged into HP-UX 11iv2?
From a windows 'front-end' they will enter their unix userid/password, which will be passed to the unix server (actually via a process that has access to the unix server). I'd then like the user's userid/password to be validated to the passwd database.
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: use 'login' to authenticate a userid/password?

Shalom,

If they are already logged in then they are already authenticated.

HP-UX uses PAM, pluggable authentication module to handle these tasks, before the user is granted access.

If you want a windows front end, then integrate the system with ADS from windows and let windows provide the GUI

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
RobertCarback
Frequent Advisor

Re: use 'login' to authenticate a userid/password?

They are not logged in. The windows-type application logs in via it's own login. We just want to verify that the user accessing the data is a valid (userid/password) user on the HP-UX server.
James R. Ferguson
Acclaimed Contributor
Solution

Re: use 'login' to authenticate a userid/password?

Hi Robert:

You can perform password validation with a simple Perl script:

# cat ./checkpw
#!/usr/bin/perl
#@(#)checkpw $ Verify Unix password - JRF $
use strict;
use warnings;
die "Usage: user passwd\n" unless @ARFV == 2;
my ($extnm, $extpw, $intnm, $intpw );
$extnm = shift;
$extpw = shift;
( $intnm, $intpw ) = getpwnam($extnm);
die "$extnm isn't a valid user\n" unless $intnm;
if ( crypt( $extpw, $intpw ) eq $intpw ) {
print "ok\n";
exit(0);
}
print "bad_pw\n";
exit (1);
1;

...run and pass two arguments, the user and his/her password.

# ./checkpw jrf jrfspw
ok

# ./checkpw robert something
bad_pw

Note, too that a succesfully validated password causes the script to return an exit status of zero (0). A failure in validation returns an exit status of one (1).

Regards!

...JRF...
RobertCarback
Frequent Advisor

Re: use 'login' to authenticate a userid/password?

thanks. got this erroron execution---

/sysprog/checkpw rcarback mypasswd
Global symbol "@ARFV" requires explicit package name at /sysprog/checkpw line 5.
Execution of /sysprog/checkpw aborted due to compilation errors.
Patrick Wallek
Honored Contributor

Re: use 'login' to authenticate a userid/password?

@ARFV should be @ARGV
James R. Ferguson
Acclaimed Contributor

Re: use 'login' to authenticate a userid/password?

Hi (again) Robert:

Yes, my friend Patrick is correct. '@ARFV' should be '@ARGV' indeed!

Regards!

...JRF...