搜索了一圈,在其他问题中找到了重置密码和新建超级用户的命令。
# 管理密码忘记了或者重置管理员密码
$ source /opt/py3/bin/activate
$ cd /opt/jumpserver/apps
$ python manage.py changepassword <user_name>
# 新建超级用户的命令如下命令
$ python manage.py createsuperuser --username=user --email=user@domain.com
在打算重置 admin 的时候,竟然发现根本就不存在这个用户(尴尬),最后新建了一个超级用户解决。
(py3) [root@V2 apps]# python manage.py changepassword admin
2018-08-28 14:43:36 [signals_handler DEBUG] Receive django ready signal
2018-08-28 14:43:36 [signals_handler DEBUG] - fresh all settings
CommandError: user ‘admin‘ does not exist
(py3) [root@V2 apps]#
(py3) [root@V2 apps]# python manage.py createsuperuser --username=UserName--email=Email@Email.com
2018-08-28 14:44:40 [signals_handler DEBUG] Receive django ready signal
2018-08-28 14:44:40 [signals_handler DEBUG] - fresh all settings
Password:
Password (again):
Superuser created successfully.