Installation phpLDAPPasswd
Cet article présente l'installation de phpLDAPPasswd sur une machine Ubuntu. Cette application est utilisée afin de pouvoir modifier son mot de passe LDAP avec une interface très simple. Attention, elle n'est plus maintenue par son auteur. Cependant elle est très simple et semble suffisamment aboutie pour les besoins exprimés.
Sommaire
Votre avis
Nobody voted on this yet
|
|
Installation
L'application est développée en php, et son installation consiste à simplement référencer celle ci dans un serveur Apache par exemple.
La version est installée dans le répertoire /var/opt
, dans lequel le tar est déployé.
sudo tar -C /var/opt -xzvf /tmp/phpLdapPasswd-0.5.tar.gz
#tar -C /var/opt -xzvf /tmp/phpLdapPasswd-0.5.tar.gz phpLdapPasswd/ phpLdapPasswd/COPYRIGHT phpLdapPasswd/CHANGES phpLdapPasswd/COPYING phpLdapPasswd/admin.php phpLdapPasswd/README phpLdapPasswd/TODO phpLdapPasswd/conf.d/ phpLdapPasswd/conf.d/phpLdapPasswd.conf phpLdapPasswd/apache.conf phpLdapPasswd/config.php phpLdapPasswd/functions.php phpLdapPasswd/index.php phpLdapPasswd/reset.php phpLdapPasswd/generators/ phpLdapPasswd/generators/randchar.php phpLdapPasswd/generators/README phpLdapPasswd/generators/apg.php phpLdapPasswd/generators/random.php phpLdapPasswd/policies/ phpLdapPasswd/policies/example.php phpLdapPasswd/policies/README phpLdapPasswd/policies/nochecks.php phpLdapPasswd/policies/xenos.php phpLdapPasswd/templates/ phpLdapPasswd/templates/README phpLdapPasswd/templates/mailReset.txt phpLdapPasswd/templates/passwordAdmin.html phpLdapPasswd/templates/passwordChange.html phpLdapPasswd/templates/passwordError.html phpLdapPasswd/templates/passwordReset.html phpLdapPasswd/templates/phpLdapPasswd.css
Propriétaire fichiers
L'installation a été réalisée avec le compte root
. Il est préférable de donner la propriété au compte de démarrage du serveur web, soit www-data
dans le cadre de cette installation.
#sudo chown -R www-data:www-data /var/opt/phpLdapPasswd
Sécurisation
Les droits mis en place seront uniquement pour le compte d'exécution du serveur Web, soit www-data
dans le cadre de cette installation.
#sudo find /var/opt/phpLdapPasswd -type f -exec chmod 0600 {} \; #sudo find /var/opt/phpLdapPasswd -type d -exec chmod 0700 {} \;
Configuration
Une fois installée, il faut configurer l'application pour lui indiquer l'emplacement de l'annuaire LDAP. Toutes les configurations sont réalisées dans le fichier config.php
, pour lequel les droits d'accès ont été modifiés précédemment. Seuls trois éléments de configurations sont importants. Les valeurs saisies, dans le cadre de cet article, sont en relation avec l'installation faite de OpenLDAP sur un serveur Ubuntu.
Paramètre | Valeur |
---|---|
$LDAPSERVER | ldap://localhost/
URL d'accès à l'annuaire LDAP. |
$LDAPPORT | 389 |
$LDAPBASEDN | ou=people,dc=ejnserver,dc=fr
Base pour la recherche d'utilisateurs. |
Le paramètres originaux sont les suivants:
// The LDAPSERVER and LDAPPORT define the server to which phpLdapPasswd should
// connect to change the password. This should be a server with write access
// and not a replica.
//
// To enable SSL, be sure to configure the LDAP server to accept SSL
// connections and make sure that the CN in the certificate used for the SSL
// connection matched what is placed in the LDAPSERVER line. The LDAPSEVER
// and LDAPPORT lines should look like the following for SSL, assuming that
// your LDAP server uses the default LDAP SSL port:
//
// $LDAPSERVER = "ldaps://YOURLDAPSERVER/";
// $LDAPPORT = 636;
//
// You may also use TLS instead of SSL. That option is defined below.
//
// The standard LDAP ports are 389 for non-SSL communications and 636 for SSL.
// If TLS is used, the port should probably be set to 389, although it is
// possible to do TLS over SSL. (In that case, just using SSL should be
// sufficient, though.)
$LDAPSERVER = "ldap://masterdir.example.com/";
$LDAPPORT = 389;
// The LDAPBASEDN is the base DN that should be used for LDAP searches. This
// should at least be set to the base DN for the LDAP server. It may, however,
// be defined as a higher base DN such as ou=People,dc=example,dc=com for
// greater security or if there are multiple phpLdapPasswd instances serving
// different trees of users.
$LDAPBASEDN = "dc=example,dc=com";
Les modifications apportées sont:
// The LDAPSERVER and LDAPPORT define the server to which phpLdapPasswd should
// connect to change the password. This should be a server with write access
// and not a replica.
//
// To enable SSL, be sure to configure the LDAP server to accept SSL
// connections and make sure that the CN in the certificate used for the SSL
// connection matched what is placed in the LDAPSERVER line. The LDAPSEVER
// and LDAPPORT lines should look like the following for SSL, assuming that
// your LDAP server uses the default LDAP SSL port:
//
// $LDAPSERVER = "ldaps://YOURLDAPSERVER/";
// $LDAPPORT = 636;
//
// You may also use TLS instead of SSL. That option is defined below.
//
// The standard LDAP ports are 389 for non-SSL communications and 636 for SSL.
// If TLS is used, the port should probably be set to 389, although it is
// possible to do TLS over SSL. (In that case, just using SSL should be
// sufficient, though.)
$LDAPSERVER = "ldap://localhost/";
$LDAPPORT = 389;
// The LDAPBASEDN is the base DN that should be used for LDAP searches. This
// should at least be set to the base DN for the LDAP server. It may, however,
// be defined as a higher base DN such as ou=People,dc=example,dc=com for
// greater security or if there are multiple phpLdapPasswd instances serving
// different trees of users.
$LDAPBASEDN = "ou=people,dc=ejnserver,dc=fr";
D'autre élément de configuration sont disponibles, mais non implémenté dans le cadre de cette installation.
Publication sous Apache
Voir aussi
La site du projet se situait à l'adresse http://www.karylstein.com/phpLdapPasswd. Malheureusement, il n'est plus disponible. Voici donc le binaire utilisée pour l'installation réalisée: PhpLdapPasswd-0.5.tar.gz