搭建ldap自助修改密碼系統--Self Service Password

系統版本:centos6 php

Self Service Password版本:1.1
html

服務安裝:apache

      安裝依賴:yum install php70-ldap.x86_64 -y (版本儘可能大於5.3,不然會提示更新php程序)
                     yum install httpd -y
      安裝Self Service Password:yum install https://ltb-project.org/rpm/6Server/noarch/self-service-password-1.1-1.el6.noarch.rpmvim

配置apache: /etc/httpd/conf.d/self-service-password.confcentos

NameVirtualHost *:80
<VirtualHost *:80>
       ServerName changepasswd.xxxxx.net
       DocumentRoot /usr/share/self-service-password
       DirectoryIndex index.php
       AddDefaultCharset UTF-8
      <Directory "/usr/share/self-service-password">
            AllowOverride None
            Require all granted
      </Directory>
      LogLevel warn   
      ErrorLog /var/log/httpd/ssp_error_log
      CustomLog /var/log/httpd/ssp_access_log combined
</VirtualHost>php7

 

配置Self Service Password,支持密碼修改和郵件重置: vim  /usr/share/self-service-password/conf/config.inc.phpide

       #關閉 問題驗證 和 短信驗證(視我的須要):post

            $use_questions=false;
            $use_sms= false;ui

      #配置 LDAP
    $ldap_url = "ldap://ldap.xxxxx.net";
    $ldap_starttls = false;
    $ldap_binddn = "cn=Manager,dc=ldap,dc=xxxxxx,dc=net";   
    $ldap_bindpw = "xxxxxxxxx";
    $ldap_base = "dc=ldap,dc=xxxxxx,dc=net";
    $ldap_login_attribute = "cn";
    $ldap_fullname_attribute = "cn";
    $ldap_filter = "(&(objectClass=person)($ldap_login_attribute={login}))";
            $who_change_password = "manager";   #指定LDAP 以什麼用戶身份更改密碼url

      #配置郵件
    $mail_from = "elk@xxxxx.com";
    $mail_from_name = "企業帳號密碼重置";
    $mail_signature = "";
            $notify_on_change = true;      #密碼修改爲功後,向用戶發送通知郵件
    $mail_sendmailpath = '/usr/sbin/sendmail';   #需安裝sendmail服務 yum install -y sendmail
    $mail_protocol = 'smtp';
    $mail_smtp_debug = 0;
    $mail_debug_format = 'html';
    $mail_smtp_host = 'smtp.gmail.com';
    $mail_smtp_auth = true;
    $mail_smtp_user = 'elk@xxxxxx.com';
    $mail_smtp_pass = 'xxxxxx';
    $mail_smtp_port = 587;
    $mail_smtp_timeout = 30;
    $mail_smtp_keepalive = false;
    $mail_smtp_secure = 'tls';
    $mail_contenttype = 'text/plain';
    $mail_wordwrap = 0;
    $mail_charset = 'utf-8';
    $mail_priority = 3;
    $mail_newline = PHP_EOL;

配置完成,登陸網頁訪問,經過網頁修改帳號密碼驗證

若是遇到如下錯誤:

修改配置: $keyphrase = "secret";   --->  $keyphrase = "ldapchangepasswd"; #任意字符串

驗證郵件重置密碼:

查看郵件,點擊連接修改便可:

修改完成會收到一條郵件:

以上即是ldap自主修改密碼服務--Self Service Password 的配置。

參考連接:http://blog.leanote.com/post/benmo/e98d072f2b28

相關文章
相關標籤/搜索