Installation phpLDAPPasswd

De EjnTricks
Révision de 17 mai 2018 à 14:28 par Etienne (discussion | contributions)

(diff) ← Version précédente | Voir la version courante (diff) | Version suivante → (diff)

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.

Hand-icon.png Votre avis

Nobody voted on this yet

 You need to enable JavaScript to vote


System-Install-icon.png 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


Icon File Owner.png 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


Icon ACL.png 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-icon.png 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.

Configuration-icon.png Publication sous Apache

Viewer icon.png 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