惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
B
Blog
P
Proofpoint News Feed
美团技术团队
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
有赞技术团队
有赞技术团队
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
H
Help Net Security
罗磊的独立博客
L
LangChain Blog
GbyAI
GbyAI
腾讯CDC
T
The Blog of Author Tim Ferriss
Microsoft Security Blog
Microsoft Security Blog

博客园 - 百衲本

Centos7 副本集模式部署 MongoDB centos7部署Nacos集群模式 centos7 yum快速安装clickhouse单机版 k8s高可用部署Seata kubernetes中pod磁盘占用排查 Python 列表生成式、字典生成式与生成器表达式 Python 的可迭代对象、迭代器对象与生成器 python email模块自动化操作邮件 python yagmail 模块自动化操作邮件 python自动化操作PDF 国内企业邓白氏编码免费申请流程 Python psutil模块 免费公共API调用清单 Python pathlib 模块 容器网络故障排查:从 ping 到 tcpdump 的全链路思路 systemd详解 APP性能指标 Linux 上禁用 USB 存储设备 线上故障的排查清单,运维小哥拿走不谢!
jumpserver V3 终端常用操作
百衲本 · 2025-11-24 · via 博客园 - 百衲本

一、进入jms核心容器并进入Python交互环境

docker exec -it jms_core /bin/bash
cd /opt/jumpserver/apps
python manage.py shell

二、常用操作

1.jumpserver  解锁用户

from django.core.cache import cache
cache.delete_pattern('_LOGIN_BLOCK_*') #如果需要解锁具体用户则可以这样写 _LOGIN_BLOCK_用户名
cache.delete_pattern('_LOGIN_LIMIT_*')
cache.delete_pattern('_MFA_BLOCK_*')
cache.delete_pattern('_MFA_LIMIT_*')

2.jumpserver  重置用户MFA

from users.models import User
u = User.objects.get(username='admin')
u.mfa_level='0'
u.otp_secret_key=''
u.save()

3.jumpserver  激活用户

from users.models import User
User.objects.filter(username='admin').update(is_active=True)

4.jumpserver  创建超级用户(管理员账号无法恢复应急使用)

python manage.py createsuperuser --username=UserName--email=Email@Email.com  #UserName  Email@Email.com 替换要创建的管理员名称和邮箱地址
Password:             #设置密码,两次要一致
Password (again): 

5.jumpserver 重置超级用户密码

python manage.py changepassword  <user_name>