< 2 HZHD-ELK - [root]: > # docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7844badd813d 56b90ffd1994 "/bin/sh /data/webap…" 2 years ago Up 4 months 8000/tcp test
1ea2e11fb6ba jumpserver/jms_all:latest "entrypoint.sh" 4 years ago Up 12 days 0.0.0.0:9999->80/tcp, 0.0.0.0:65022->2222/tcp jmpsafe
< 3 HZHD-ELK - [root]: > # docker exec -it jmpsafe bash
[root@1ea2e11fb6ba opt]# ls
coco jumpserver luna py3 readme.txt
[root@1ea2e11fb6ba opt]# cd jumpserver/
[root@1ea2e11fb6ba apps]# source /opt/py3/bin/activate
(py3) [root@1ea2e11fb6ba apps]# python3.6 manage.py changepassword chenlei
Changing password for user 'chenlei(chenlei)'
Password:
Password (again):
Password changed successfully for user 'chenlei(chenlei)'
#进入数据库修改密码有效期:
[root@1ea2e11fb6ba opt]# echo $DB_USER
jmpsafe
[root@1ea2e11fb6ba opt]# echo $DB_PASSWORD
jmpsafe2020..
< 2 HZHD-ELK - [root]: > # mysql -ujmpsafe -pjmpsafe2020..
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| jmpsafe |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql> use jmpsafe
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select username,date_expired,date_password_last_updated from users_user where username='user';
+----------+----------------------------+----------------------------+
| username | date_expired | date_password_last_updated |
+----------+----------------------------+----------------------------+
| user | 2092-04-06 02:12:00.000000 | 2022-04-24 02:13:27.058186 |
+----------+----------------------------+----------------------------+
1 row in set (0.00 sec)
mysql> update users_user set date_password_last_updated='2025-12-24' where username='user';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select username,date_expired,date_password_last_updated from users_user where username='user';
+----------+----------------------------+----------------------------+
| username | date_expired | date_password_last_updated |
+----------+----------------------------+----------------------------+
| user | 2092-04-06 02:12:00.000000 | 2025-12-24 00:00:00.000000 |
+----------+----------------------------+----------------------------+
1 row in set (0.00 sec)
标签:username,过期,1ea2e11fb6ba,密码,堡垒,user,mysql,date,root
From: https://www.cnblogs.com/anslinux/p/17474451.html