Tips on configuring Moodle w/ PAM Kerberos

Tips on configuring Moodle w/ PAM Kerberos

by Jeremy Lipson -
Number of replies: 1
I just wanted to document what process I had to take to get Moodle to work with PAM/Kerberos on CentOS5. The problem is php4-pam is COMPLETELY dead and no longer hosted. You need to official PECL pam library!

1) Make sure you have these libraries:

pam_krb5.i386
pam-devel
pam
pam_ccreds
krb5-devel

sudo yum install

(Assuming you already have Kerberos / Pam installed and configured to your liking)


* You need Pecl/Pear to get this part to work

2) pecl install pam

3) If this fails (an error about not enough memory) Increment the memory given to Pear by editing: "/usr/PEAR/pearcmd.php"
with something like " @ini_set('memory_limit','12M'); "


4) Open up /etc/php.ini add: "extension=pam.so" in the dynamic library section (or wherever you want)

5) Create a file called: /etc/pam.d/php and put in a configuration like this:

auth sufficient pam_krb5.so debug
auth required pam_deny.so
account [default=bad success=ok user_unknown=ignore] pam_krb5.so debug

6) Restart httpd

7) Enable PAM in Moodle: "Users" >> "Authentication"

You can test 'pam' in general by doing:

<?php
if (function_exists('pam_auth')) {

if(pam_auth('jel65','xxxxxxx')) {
echo "SUCCESS!";
}
else {
echo "FAIL!";
}

}

?>

and also try: <?php echo phpinfo(); ?> (it should have PAM module installed smile)

To really see if it's authenticating go to:

"less /var/log/secure"




I hope this helps somebody!
Average of ratings: -