Forgotten password
Recover the built-in administrator by clearing its password hash and restarting to get the factory password back; reset other users' passwords from the admin console.
Built-in administrator forgot the password
Passwords are stored as argon2id hashes and cannot be written by hand. The built-in administrator's factory password, however, is seeded at startup: if the built-in administrator has no password, startup sets it to the factory password imgyoung123 and marks it as requiring a change. Clearing its password_hash and restarting therefore brings you back to the first sign-in.
There is no dedicated reset command: one SQL statement does the job. This path requires a shell on the server or access to the database, which means control of the machine, so it is not a remote attack surface.
The built-in administrator's ID in the users table is always default. Its username can be changed in the admin console, so the commands below select it by ID rather than by name.
From the restart until you change the password, anyone can sign in with the public factory password and change it before you do. Sign in and change it right after the restart.
Requires sqlite3 on the machine. Stop the imgyoung process, then run this against the database in the data directory (data/ under the directory you start it from, or the directory set by IMGYOUNG_DATA_DIR):
sqlite3 data/imgyoung.db "UPDATE users SET password_hash = '' WHERE id = 'default';"Then start imgyoung again.
The log line 已初始化默认管理员密码,请登录后立即在后台修改 means the password was seeded. Sign in with the built-in administrator's username (admin unless you renamed it) and imgyoung123; you land directly on Set the admin password, and after changing it you sign in again with the new password.
The password change is enforced by the server: until the factory password is changed, that session can only sign out, read its own account (GET /api/admin/me) and change the password; every other admin API returns 403 须先修改出厂默认密码 ("the factory default password must be changed first"), scripts calling the API directly included.
This only works for the built-in administrator. Clearing another user's password_hash just makes that account unable to sign in; no password is restored.
Resetting another user's password
Administrators can reset any user's password in the admin console, including another administrator's: on Users, open the action menu at the end of the user's row (More actions), choose Reset password, and enter a new password of at least 8 characters.
- The reset takes effect immediately and ends all of that user's sessions; they sign in again with the new password.
- The user is not required to change a reset password after signing in.
- Each reset writes an audit entry (action
user.update, detailpassword.reset).
Users who still know their old password can change it themselves with Change password in the account menu in the sidebar. For the API, see the API reference.