JumpServer忘记登录密码和用户被锁定的处理方法

心平气和看事 2024-08-14 02:33:42

概述本文主要介绍堡垒机使用过程中产生的密码相关问题。主要包括忘记密码、密码过期、以及登录频繁账号被锁定。

概述

本文主要介绍堡垒机使用过程中产生的密码相关问题。主要包括忘记密码、密码过期、以及登录频繁账号被锁定。

忘记密码,密码过期问题描述

在使用 JumpServer 的过程中,可能会因为忘记密码或密码过期而造成不能登录堡垒机的情况。

密码过期设置

“系统设置”–》“安全设置”–》“用户密码过期时间”。

解决方式邮件找回

提前设置好邮箱配置,通过邮箱进行找回密码的操作。(该方法的前提是已经设置好邮件等配置)

控制台找回

以 admin 用户的密码为例:

[root@jmupserver ~]# docker exec -it jms_core /bin/bash #进入容器内部root@94b823ed3113:/opt/jumpserver# cd /opt/jumpserver/apps/root@94b823ed3113:/opt/jumpserver/apps# python manage.py shellPython 3.8.13 (default, Mar 17 2022, 06:22:23) Type 'copyright', 'credits' or 'license' for more informationIPython 8.1.1 -- An enhanced Interactive Python. Type '?' for help.In [1]: from users.models import UserIn [2]: u = User.objects.get(username='test') #test 是您要修改的用户名In [3]: u.reset_password('password') #password 是您要重置的密码In [4]: u.save()In [5]: exitroot@94b823ed3113:/opt/jumpserver/apps#

登录频繁账号被锁定问题描述

如若在“系统设置”–》“安全设置”–》“登录设置”中设置了限制登录失败次数,如下图所示。

登录失败超过指定次数后,就会造成账号被锁定。

问题解决联系管理员

联系管理员进行解锁

后台重置[root@jmupserver ~]# docker exec -it jms_core /bin/bashroot@94b823ed3113:/opt/jumpserver# cd /opt/jumpserver/apps/root@94b823ed3113:/opt/jumpserver/apps# python manage.py shellPython 3.8.13 (default, Mar 17 2022, 06:22:23) Type 'copyright', 'credits' or 'license' for more informationIPython 8.1.1 -- An enhanced Interactive Python. Type '?' for help.In [1]: from django.core.cache import cacheIn [2]: cache.delete_pattern('_LOGIN_BLOCK_*')Out[2]: 1In [3]: cache.delete_pattern('_LOGIN_LIMIT_*')Out[3]: 2In [4]: exit
0 阅读:4

心平气和看事

简介:感谢大家的关注