cvs: pecl /pam README

From: Date: Mon, 13 Nov 2006 07:58:47 +0000
Subject: cvs: pecl /pam README
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-6632@lists.php.net to get a copy of this message
mikl Mon Nov 13 07:58:47 2006 UTC Modified files: /pecl/pam README Log: Added FAQ section from "pam_auth" to README http://cvs.php.net/viewvc.cgi/pecl/pam/README?r1=1.1&r2=1.2&diff_format=u Index: pecl/pam/README diff -u pecl/pam/README:1.1 pecl/pam/README:1.2 --- pecl/pam/README:1.1 Mon Nov 13 07:47:40 2006 +++ pecl/pam/README Mon Nov 13 07:58:47 2006 @@ -1,8 +1,9 @@ -API - bool pam_auth(string $username, string $password [ , string &$error ]); + bool pam_auth(string $username, string $password [, string &$error ]) + bool pam_chpass(string $username, string $oldpassword, string $newpassword [, string &$error ]) -PAM SETUP + +INSTALLATION For pam_auth to work, pam must know about the php service. @@ -36,4 +37,70 @@ These would authenticate out of the unix password and shadow file. However please checking other /etc/pam.d/ entries, as the libraries these examples - point to may not be correct. \ No newline at end of file + point to may not be correct. + + +FAQ + + * What is PAM? + + PAM stands for Pluggable Authentication Module. It is a system that abstracts + user authentication to allow arbitrary modules to handle the real work. In this + way, pam enabled services can use a variety of complex authentication schemes + without modifying the applications. For more Information, and available + modules, see http://www.kernel.org/pub/linux/libs/pam/. + + + * Why would I want to use PAM from PHP? + + PAM gives you very flexible control over authentication. As an example, there + are PAM modules that will authenticate against a local shadow or password file, + a Windows NT domain, an SQL database, LDAP, Kerberos, Radius, and more. In + addition, pam modules can give you the ability to have restrictions on the + authentication, such as the pam_tally module which limits the number of login + attempts, and the pam_listfile which let's you restrict access to a list of + users. Please note, using pam does not mean you can securely authenticate + users, it simply gives you the ability to do so with proper configuration and + planning. + + + * How can I get pam? + + If you are running linux or solaris, you already have it! Linux and Solaris + both natively use pam for all authentication, so you're are all set. If you are + on other systems, well, you're on your own. I have no idea what PAM has been + ported too... + + + * I'm getting an Authentication Failure error, why? + + The most likely reason for this is that you are trying to authenticate via a + local shadow file and you do not have permission to do so. The PAM modules + handling shadow authentication (used on Linux and Solaris) require that the + application have permission to read the shadow file (makes sense, eh?). If you + are running php as a cgi or as a webserver module, it is executed as your + webservers user and group. + + By default, most Linux and Solaris systems are configured to only allow the root + user to read the shadow file. The recommended + way around this is to change permissions on the shadow file so that it is group + readable, and chgrp the file to the a group that the webserver is in. Before + doing this, you should give it some serious thought as allowing your webserver + to read the shadow file gives hackers another way to crack away at your system. + + If you decide to enable this, I stronly suggest usage of the pam_tally module + to limit failed logins to a reasonable number of attempts, and one of the other + modules which will allow you to block root and other system users. + + + * The pam_auth function doesn't return anything, whattup? + + Did you remember to create an entry in the pam configuration for the php + service? + + + * Logs indicate pam authenticated the user, but the function doesn't return + true, what gives? + + Make sure your pam configuration has an entry for both auth and account, if you + do not have both, it will not work.

« previous php.pecl.cvs (#6632) next »