• 搭建ldap自助修改密码系统--Self Service Password


    系统版本:centos6 

    Self Service Password版本:1.1

    服务安装:

          安装依赖: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.rpm

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

    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>

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

           #关闭 问题验证 和 短信验证(视个人需要):

                $use_questions=false;
                $use_sms= false;

          #配置 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 以什么用户身份更改密码

          #配置邮件
        $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

    赠人玫瑰,手有余香,如果我的文章有幸能够帮到你,麻烦帮忙点下右下角的推荐,谢谢!

    作者: imcati

    出处: https://www.cnblogs.com/imcati/>

    本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出, 原文链接

  • 相关阅读:
    Logstash 安装并把mysql数据同步到elasticsearch
    springboot 集成elasticsearch
    centos7 搭建Elasticsearch集群
    centos7 elasticsearch 安装
    elasticsearch 深度分页以及scroll 滚动搜索
    elasticsearch DSL常用查询总结
    elasticsearch ik分词器自定义词库
    elasticsearch 安装IK中文分词器
    elasticsearch 分词与内置分词器
    elasticsearch 文档乐观锁控制 if_seq_no与if_primary_term
  • 原文地址:https://www.cnblogs.com/imcati/p/9396808.html
Copyright © 2020-2023  润新知