<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 9pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;"> Hi. Thank you very much!<br><br>My system-auth file is :<br><br style="font-weight: bold;"><span style="font-weight: bold;">#%PAM-1.0</span><br style="font-weight: bold;"><span style="font-weight: bold;"># This file is auto-generated.</span><br style="font-weight: bold;"><span style="font-weight: bold;"># User changes will be destroyed the next time authconfig is run.</span><br style="font-weight: bold;"><span style="font-weight: bold;">auth        required      /lib/security/$ISA/pam_env.so</span><br style="font-weight: bold;"><span style="font-weight: bold;">auth        sufficient    /lib/security/$ISA/pam_unix.so likeauth nullok</span><br style="font-weight: bold;"><span style="font-weight: bold;">auth        required      /lib/security/$ISA/pam_deny.so</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">account     required      /lib/security/$ISA/pam_unix.so</span><br style="font-weight: bold;"><span style="font-weight: bold;">account     sufficient    /lib/security/$ISA/pam_succeed_if.so uid < 100 quiet</span><br style="font-weight: bold;"><span style="font-weight: bold;">account     required      /lib/security/$ISA/pam_permit.so</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">password    requisite     /lib/security/$ISA/pam_cracklib.so retry=3</span><br style="font-weight: bold;"><span style="font-weight: bold;">password    sufficient    /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow nis</span><br style="font-weight: bold;"><span style="font-weight: bold;">password    required      /lib/security/$ISA/pam_deny.so</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">session     required      /lib/security/$ISA/pam_limits.so</span><br style="font-weight: bold;"><span style="font-weight: bold;">session     required      /lib/security/$ISA/pam_unix.so</span><br><br><br></div>What I mean is that " PHP application send the password to the C CGI program which performs the authentication using PAM".<br><br>but what is it the different with the "does the user send the password to the C CGI program which performs the integration using PAM"?<br><br>I think your method do make sense that  I will use SSL to send the password to a CGI program ,and then the CGI program performs the authentication using PAM.<br><br>But it happens at the user login. After login, I need save the username and password in the PHP session,<br><br>and for security ,  I think I should save the hashed password with MD5 which can be sent back by CGI program.<br><br>When user performs some operations on the PHP application , for security, I need to send the username and password to  CGI program which will auth it again, and then <br><br>do some operations, but at  this time  the password I sent is MD5 password , so i need C CGI program auth the MD5 password.<br><br>I don't know how to do it or whether my method is correct.<br><br>Thank you very much!<br><br><br>Chu Qiu<br><br><br><hr id="stopSpelling">> From: inkubus@interalpha.co.uk<br>> To: pam-list@redhat.com<br>> Date: Wed, 21 Nov 2007 11:06:25 +0000<br>> Subject: re: How auth the md5 password using pam<br>> <br>> > I have developed a PHP application using  PAM auth , and whose config<br>> > file in the /etc/pam.d is :<br>> > <br>> >  <br>> > <br>> > #%PAM-1.0<br>> > <br>> > auth       required     pam_stack.so service=system-auth<br>> > <br>> > auth       required     pam_nologin.so<br>> > <br>> > account    required     pam_stack.so service=system-auth<br>> <br>> You may also want to post the contents of /etc/pam.d/system-auth, seeing<br>> as this uses it.<br>>  <br>> > I will send the username and password to a CGI program written by C<br>> > language modules and PAM APIs.<br>> Sorry; it's not clear (at least to me) what you mean.  Does your PHP<br>> application send the password to the C CGI program which then performs<br>> the authentication using PAM.  Or does the user send the password to the<br>> C CGI program which performs the integration using PAM - if so what does<br>> the PHP app have to do with it?<br>> <br>> > Now I want to encrypt the password with md5, and send username and the<br>> > MD5 encrypted password to CGI .<br>> Firstly MD5 is not encryption, it's a hashing algorithm.  Secondly if<br>> you want to communicate securely with a web application, either from<br>> another web application or from a PAM module, then you need to do more<br>> than just encrypt the password; look up TLS and SSL.<br>> <br>> > But I donʼt know how to modify my PAM config file to make it support<br>> > auth the MD5 password.<br>> By the sounds of it, if you are trying to communicate passwords between<br>> applications (I'd also suggest that this is never a very secure nor<br>> sensible way of doing things), then this has nothing to do with PAM.<br>> <br>> HTH<br>> <br>> Cheers,<br>>  - Martin<br>> <br>> <br>> <br>> _______________________________________________<br>> Pam-list mailing list<br>> Pam-list@redhat.com<br>> https://www.redhat.com/mailman/listinfo/pam-list<br><br /><hr />用 Windows Live Spaces 展示个性自我,与好友分享生活!  <a href='http://spaces.live.com/?page=HP' target='_new'>了解更多信息!</a></body>
</html>