📌 📄 内容摘要:
小鸟壁纸 (@xnbz) 在 SUB2API管理员密码忘记的修改方法 中发帖
密码以 bcrypt 哈希存储在 PostgreSQL 的 users 表中。
步骤:
进入 PostgreSQL 容器:
docker compose exec postgres psql -U sub2api -d sub2api
生成新密码的 bcrypt 哈希(在宿主机执行):
# 用 Python 生成 bcrypt hash(在有python的电脑执行,密码改成你想要的)
python3 -c "import bcrypt; print(bcrypt.hashpw(b'your_new_password', bcrypt.gensalt(10)).decode())"
在 psql 中更新密码:
UPDATE users SET password_hash = '(刚刚生成的)$2a$10$...' WHERE role = 'admin';
SELEC...
────────── 链接信息 ────────── 🔗 论坛链接: linux.do 📎 访问地址: https://linux.do/t/topic/2041575/1 ─────────────────────────────
📢 来源:LINUX DO