如果忘记admin的登录密码,可按如下方法处理 # 编辑config.xml文件,替换passwordHash行的内容# vim /var/lib/jenkins/users/admin_1679382529066310837/config.xml <passwordHash>#jbcrypt:$2a$$MiIVR0rr/UhQBqT.bBq0QehTiQVqgNpUGyWW2nJObaVAM/2xSQdSq</passwordHash> # 修改后重启jenkins system
python manage.py shell 然后获取你的用户名,并且重设密码:from django.contrib.auth.models import User user = User.objects.get(username='admin')user.set_password('new_password')user.save()