首页 > 其他分享 >OpenLDAP:使用Self Service Password管理用户密码

OpenLDAP:使用Self Service Password管理用户密码

时间:2023-09-24 10:22:23浏览次数:33  
标签:service Service SMS Self sms OpenLDAP mail password recaptcha

安装docker

yum -y install docker

拉取镜像

docker pull grams/ltb-self-service-password

编辑配置文件

<?php
#==============================================================================
# LTB Self Service Password
#
# Copyright (C) 2009 Clement OUDOT
# Copyright (C) 2009 LTB-project.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# GPL License: http://www.gnu.org/licenses/gpl.txt
#
#==============================================================================

#==============================================================================
# Configuration
#==============================================================================
# LDAP
$ldap_url = "ldap://x.x.x.x:389";
$ldap_starttls = false;
$ldap_binddn = "cn=admin,dc=xxx,dc=com";
$ldap_bindpw = "xxx";
$ldap_base = "dc=xxx,dc=com";
$ldap_login_attribute = "uid";
$ldap_fullname_attribute = "cn";
$ldap_filter = "(&(objectClass=person)($ldap_login_attribute={login}))";


# Active Directory mode
# true: use unicodePwd as password field
# false: LDAPv3 standard behavior
$ad_mode = false;
# Force account unlock when password is changed
$ad_options['force_unlock'] = false;
# Force user change password at next login
$ad_options['force_pwd_change'] = false;
# Allow user with expired password to change password
$ad_options['change_expired_password'] = false;

# Samba mode
# true: update sambaNTpassword and sambaPwdLastSet attributes too
# false: just update the password
$samba_mode = false;
# Set password min/max age in Samba attributes
#$samba_options['min_age'] = 5;
#$samba_options['max_age'] = 45;

# Shadow options - require shadowAccount objectClass
# Update shadowLastChange
$shadow_options['update_shadowLastChange'] = false;

# Hash mechanism for password:
# SSHA
# SHA
# SMD5
# MD5
# CRYPT
# clear (the default)
# auto (will check the hash of current password)
# This option is not used with ad_mode = true
$hash = "SSHA";

# Prefix to use for salt with CRYPT
$hash_options['crypt_salt_prefix'] = "$6$";

# Local password policy
# This is applied before directory password policy
# Minimal length
$pwd_min_length = 8;
# Maximal length
$pwd_max_length = 12;
# Minimal lower characters
$pwd_min_lower = 1;
# Minimal upper characters
$pwd_min_upper = 1;
# Minimal digit characters
$pwd_min_digit = 1;
# Minimal special characters
$pwd_min_special = 0;
# Definition of special characters
$pwd_special_chars = "^a-zA-Z0-9";
# Forbidden characters
#$pwd_forbidden_chars = "@%";
# Don't reuse the same password as currently
$pwd_no_reuse = true;
# Check that password is different than login
$pwd_diff_login = true;
# Complexity: number of different class of character required
$pwd_complexity = 0;
# Show policy constraints message:
# always
# never
# one rror
$pwd_show_policy = "never";
# Position of password policy constraints message:
# above - the form
# below - the form
$pwd_show_policy_pos = "above";

# Who changes the password?
# Also applicable for question/answer save
# user: the user itself
# manager: the above binddn
$who_change_password = "user";

## Standard change
# Use standard change form?
$use_change = true;

## Questions/answers
# Use questions/answers?
# true (default)
# false
$use_questions = false;

# Answer attribute should be hidden to users!
$answer_objectClass = "extensibleObject";
$answer_attribute = "info";

# Extra questions (built-in questions are in lang/$lang.inc.php)
#$messages['questions']['ice'] = "What is your favorite ice cream flavor?";

## Token
# Use tokens?
# true (default)
# false
$use_tokens = true;
# Crypt tokens?
# true (default)
# false
$crypt_tokens = true;
# Token lifetime in seconds
$token_lifetime = "3600";

## Mail
# LDAP mail attribute
$mail_attribute = "mail";
# Who the email should come from
$mail_from = "[email protected]";
$mail_from_name = "Self Service Password";
# Notify users anytime their password is changed
$notify_on_change = true;
# PHPMailer configuration (see https://github.com/PHPMailer/PHPMailer)
$mail_sendmailpath = '/usr/sbin/sendmail';
$mail_protocol = 'smtp';
$mail_smtp_debug = 1;
$mail_debug_format = 'html';
$mail_smtp_host = 'smtp.exmail.qq.com';
$mail_smtp_auth = true;
$mail_smtp_user = '[email protected]'; 
$mail_smtp_pass = 'xxx';
$mail_smtp_port = 465; $mail_smtp_timeout = 30; $mail_smtp_keepalive = false;
#ssl还是tls根据情况改写
$mail_smtp_secure = 'ssl';
$mail_contenttype = 'text/plain';
$mail_charset = 'utf-8';
$mail_priority = 3;
$mail_newline = PHP_EOL;

## SMS
# Use sms
$use_sms = false;
# GSM number attribute
$sms_attribute = "mobile";
# Partially hide number
$sms_partially_hide_number = true;
# Send SMS mail to address
$smsmailto = "{sms_attribute}@service.provider.com";
# Subject when sending email to SMTP to SMS provider
$smsmail_subject = "Provider code";
# Message
$sms_message = "{smsresetmessage} {smstoken}";

# SMS token length
$sms_token_length = 6;

# Max attempts allowed for SMS token
$max_attempts = 3;

# Reset URL (if behind a reverse proxy)
#$reset_url = $_SERVER['HTTP_X_FORWARDED_PROTO'] . "://" . $_SERVER['HTTP_X_FORWARDED_HOST'] . $_SERVER['SCRIPT_NAME'];

# Display help messages
$show_help = true;

# Language
$lang ="en";

# Display menu on top
$show_menu = true;

# Logo
$logo = "images/ltb-logo.png";

# Background image
$background_image = "images/unsplash-space.jpeg";

# Debug mode
$debug = false;

# Encryption, decryption keyphrase
$keyphrase = "secret";

# Where to log password resets - Make sure apache has write permission
# By default, they are logged in Apache log
#$reset_request_log = "/var/log/self-service-password";

# Invalid characters in login
# Set at least "*()&|" to prevent LDAP injection
# If empty, only alphanumeric characters are accepted
$login_forbidden_chars = "*()&|";

## CAPTCHA
# Use Google reCAPTCHA (http://www.google.com/recaptcha)
$use_recaptcha = false;
# Go on the site to get public and private key
$recaptcha_publickey = "";
$recaptcha_privatekey = "";
# Customization (see https://developers.google.com/recaptcha/docs/display)
$recaptcha_theme = "light";
$recaptcha_type = "image";
$recaptcha_size = "normal";

## Default action
# change
# sendtoken
# sendsms
$default_action = "change";

## Extra messages
# They can also be defined in lang/ files
#$messages['passwordchangedextramessage'] = NULL;
#$messages['changehelpextramessage'] = NULL;

# Launch a posthook script after successful password change
#$posthook = "/usr/share/self-service-password/posthook.sh";

?>

启动docker

docker run -p 8000:80 -d \
-v ~/config.inc.php:/usr/share/self-service-password/conf/config.inc.php \
--name ldap-ssp \
grams/ltb-self-service-password

 

标签:service,Service,SMS,Self,sms,OpenLDAP,mail,password,recaptcha
From: https://www.cnblogs.com/wanglilu1987/p/17725666.html

相关文章

  • Name or service not known异常处理方法总结
    本人用VmWorkStationPro搭建立centos7环境,在配置静态ip后,虚机与物理主机网络连通,但是虚机却无法访问外网,贴个图吧 也就是Nameorservicenotknown这个错误。本人虚拟机网络为桥接,物理主机连接的是家里的wifi。以下是本人解决无法访问外网的步骤:1.cd/etc/sysconfig/networ......
  • DTS Data Transfer Service 数据传输服务是什么
    DTS(DataTransferService,数据传输服务)是一种用于在不同数据库之间迁移数据的服务。DTS可以帮助用户在不同数据库、不同数据存储之间传输数据,以满足业务需求和技术升级等场景。DTS通常支持多种源数据库和目标数据库之间的数据迁移,如MySQL、PostgreSQL、Oracle、SQLServer等。D......
  • 解决:idea services窗口不显示端口号
    1.关闭所有java进程2.到此目录下“C:\Users\用户名\AppData\Local\Temp\hsperfdata_用户名”,将“hsperfdata_用户名”文件夹删除。3.IDEA重启一下,在Dashboard中启动项目,则可以在DashBoard中看到相应进程后面的端口号。 ......
  • 服务网格化Service mesh 学习01 架构发展历史
    一、架构发展历史......
  • centos7 yum安装freeradius并配置到openldap进行简单认证
    1.yum安装freeradiusyum-yinstallfreeradiusfreeradius-utilsfreeradius-ldapvim2.编辑vim /etc/raddb/mods-available/ldap根据实际情况修改dc的值[root@localhost~]#cat/etc/raddb/mods-available/ldap|grep-v"#"|grep-v"^$"ldap{serv......
  • WebService 调用服务器上exe应用程序
    转自:https://blog.csdn.net/tangkechu/article/details/7047147最近在一个项目中用到这样的需求,需要PDA通过WebService来启动服务器上的一个exe应用程序,这个exe应用程序是有界面的。当我通过以下代码来启动这个exe时,问题出现了。程序并没有运行,但是在任务管理器里面却可以看到这......
  • Denpendcy Injection 8.0新功能——KeyedService
    DenpendcyInjection8.0新功能——KeyedService本文只介绍.NETDenpendcyInjection8.0新功能——KeyedService,假定读者已熟练使用之前版本的功能。注册带Key的类8.0之前,注册一个类往往是AddSingleton<IFoo,Foo>(),8.0添加了一个新功能:“可以注册一个带Key的类”AddKeyedSin......
  • 【漏洞复现】亿赛通 电子文档安全管理系统 DecryptApplicationService2 任意文件上传
    1、简介亿赛通电子文档安全管理系统(简称:CDG)是一款电子文档安全加密软件,该系统利用驱动层透明加密技术,通过对电子文档的加密保护,防止内部员工泄密和外部人员非法窃取企业校心重要数据资产,对电子文档进行全生命周期防护,系统具有透明加密、主动加密、智能加密等多种加密方式,用户可......
  • centos7 环境下yum安装openldap
    1.安装相关openldap的软件yum-yinstallopenldapopenldap-serversopenldap-clientsopenldap-develcompat-openldap2.openldap相关的文件配置/etc/openldap/slapd.conf:OpenLDAP的主配置文件,记录根域信息,管理员名称,密码,日志,权限等/etc/openldap/slapd.d/:这下面是/etc/o......
  • ORA-12519: TNS:no appropriate service handler found 解决
    #processes、sessions是扩大并发连接数,是同时使用。#公式:sessions=processes*1.1+5selectcount(*)fromv$process--当前的连接数selectvaluefromv$parameterwherename='processes'--数据库允许的最大连接数showparametersession;--查看最大会话数修改最......