ldap-passwd-reset
)
ipa -n user-add "ldap-passwd-reset" --first="Service" --last="Password reset" --password-expiration="2050-01-01Z" --password "CHANGE_ME_PLEASE"
ipa role-add "Self Password Reset"
ipa role-add-member "Self Password Reset" --users="ldap-passwd-reset"
ipa role-add-privilege "Self Password Reset" --privileges="Modify Users and Reset passwords"
ipa role-add-privilege "Self Password Reset" --privileges="Password Policy Readers"
ipa role-add-privilege "Self Password Reset" --privileges="Kerberos Ticket Policy Readers"
ipa permission-mod "System: Change User password" --includedattrs="krbloginfailedcount"
mkdir $(ipa -n user-show "ldap-passwd-reset" --raw |grep 'homedirectory' |awk -F':' '{print $2}')
chown ldap-passwd-reset.ldap-passwd-reset $(ipa -n user-show "ldap-passwd-reset" --raw |grep 'homedirectory' |awk -F':' '{print $2}')
chmod 750 $(ipa -n user-show "ldap-passwd-reset" --raw |grep 'homedirectory' |awk -F':' '{print $2}')
RHEL/CentOS 7
yum install -y python-virtualenv python-pip python-ipaclient git-core
RHEL/CentOS 8
dnf install -y python3-virtualenv python3-pip python3-ipaclient git-core
/opt/data/IPAPasswordReset/
, but you can change it.):
git clone https://github.com/larrabee/freeipa-password-reset.git /opt/data/IPAPasswordReset/
RHEL/CentOS 7
cd /opt/data/IPAPasswordReset/
virtualenv --system-site-packages ./virtualenv
. ./virtualenv/bin/activate
pip install -r requirements.txt
RHEL/CentOS 8
cd /opt/data/IPAPasswordReset/
virtualenv-3 --system-site-packages ./virtualenv
. ./virtualenv/bin/activate
pip install -r requirements.txt
ipa-getkeytab -p ldap-passwd-reset -k /opt/data/IPAPasswordReset/ldap-passwd-reset.keytab
chown -R ldap-passwd-reset:ldap-passwd-reset /opt/data/IPAPasswordReset
cp service/ipa-password-reset.conf /etc/httpd/conf.d/ipa-password-reset.conf
systemctl reload httpd
yum install -y redis
systemctl enable --now redis
PasswordReset/PasswordReset/settings.py.example
to PasswordReset/PasswordReset/settings.py
and modify it. You should change following vars:
SECRET_KEY = "Your CSRF protection key. It must be long random string"
LDAP_USER = "LDAP user. Default is ldap-passwd-reset"
KEYTAB_PATH = "Path to ldap-passwd-reset keytab. Default is ../ldap-passwd-reset.keytab"
PROVIDERS = {...} # Configuration of 2FA providers like Amazon SNS (SMS), Email, Slack, Signal
9. Install systemd unit and start the app:
cp service/ldap-passwd-reset.service /etc/systemd/system/ldap-passwd-reset.service systemctl daemon-reload systemctl enable --now ldap-passwd-reset.service
## Enjoy!
* Open [https:/ipa.example.com/reset/](https://ipa.example.com/reset/) (replace ipa.example.com with your FreeIPA hostname)
* Enter the user uid and click 'Reset Password'
* On next page enter the security code from SMS and enter new password twice and click 'Reset'
* Try to login to FreeIPA with new password
## Screenshots
![Main Page](/service/main.png?raw=true "Main Page")
![Confirmation Page](/service/reset.png?raw=true "Confirmation Page")
## License
GPLv3