reset-password
命令允许您将初始管理员账户的密码重置为随机生成的12位密码,包含大写字母、小写字母、数字和特殊符号。
此功能在 v2.0.0-rc.4
版本中引入。
要重置初始用户的密码,请运行:
nginx-ui reset-password --config=/path/to/app.ini
此命令将:
--config
:(必填)Nginx UI 配置文件的路径# 使用默认配置文件位置重置密码
nginx-ui reset-password --config=/path/to/app.ini
# 输出将包含生成的密码
2025-03-03 03:24:41 INFO user/reset_password.go:52 confPath: ../app.ini
2025-03-03 03:24:41 INFO user/reset_password.go:59 dbPath: ../database.db
2025-03-03 03:24:41 INFO user/reset_password.go:92 User: root, Password: X&K^(X0m(E&&
如果您使用 Linux 一键安装脚本安装的 Nginx UI,配置文件位于:
/usr/local/etc/nginx-ui/app.ini
您可以直接使用以下命令:
nginx-ui reset-password --config /usr/local/etc/nginx-ui/app.ini
如果您在 Docker 容器中运行 Nginx UI,需要使用 docker exec
命令:
docker exec -it <nginx-ui-container> nginx-ui reset-password --config=/etc/nginx-ui/app.ini
请将 <nginx-ui-container>
替换为您实际的容器名称或 ID。