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

推荐订阅源

F
Fortinet All Blogs
MyScale Blog
MyScale Blog
Microsoft Security Blog
Microsoft Security Blog
量子位
B
Blog
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
T
The Exploit Database - CXSecurity.com
N
News | PayPal Newsroom
Cloudbric
Cloudbric
A
About on SuperTechFans
AI
AI
Hacker News: Ask HN
Hacker News: Ask HN
S
Schneier on Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 最新话题
T
The Blog of Author Tim Ferriss
Simon Willison's Weblog
Simon Willison's Weblog
有赞技术团队
有赞技术团队
H
Heimdal Security Blog
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
D
Docker
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic
IT之家
IT之家
Know Your Adversary
Know Your Adversary
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
B
Blog RSS Feed
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
博客园 - 叶小钗
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
The Hacker News
The Hacker News
Y
Y Combinator Blog
I
Intezer
The Register - Security
The Register - Security
F
Full Disclosure
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler

博客园 - 百衲本

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>