Blog

Reset the panel's admin password on Linux, Windows and Android

The panel does not e-mail a reset link. A person with access to the server sets a new password with one command, and every browser sign-in of that account ends. The commands for Linux, Windows and Android, the checks, and the result of the test on a phone.

Reset the panel's admin password on Linux, Windows and Android

2026-11-29

Use this when you have access to the server but not the admin password. The panel has no e-mail reset, so a person with access to the server runs one command. You type the new password when asked. It is never put on the command line, and an AI agent never types it.

What the command does

  1. Sets the new password. It needs at least 12 characters, an upper-case letter, a lower-case letter and a digit.
  2. Ends every browser sign-in of that account at once. API tokens are not changed: revoke them on the API Tokens page if they must stop too.
  3. Clears the temporary lock that follows too many wrong passwords.
  4. Leaves two-factor sign-in as it was. If two-factor is on, its code is still asked.
  5. Writes an audit entry, auth.password.reset, with the account name. The password is written nowhere.

Find the sign-in name first

  1. Run list-users. It prints one line per account: the sign-in name, the e-mail address, the roles, the status and whether two-factor is on. It never prints a password or a password hash.

Linux (Ubuntu, Debian, AlmaLinux, Rocky Linux, Fedora, Linux Mint)

# 1. The sign-in names
(set -a; . /etc/aihostingpanel/aihostingpanel.env; set +a; node /opt/aihostingpanel/api/dist/cli.mjs list-users)

# 2. The new password, typed when asked
read -rs PW && printf '%s\n' "$PW" | (set -a; . /etc/aihostingpanel/aihostingpanel.env; set +a; node /opt/aihostingpanel/api/dist/cli.mjs reset-password --username NAME)
  1. Run as root on the server. The command reads the settings file itself, so you never print it.

Windows

# 1. The sign-in names
& "C:\Program Files\AIHostingPanel\node\node.exe" --env-file="C:\aihostingpanel\config\api.env" "C:\Program Files\AIHostingPanel\current\api\dist\cli.mjs" list-users

# 2. The new password, typed when asked
$pw = Read-Host "New password" -AsSecureString; $plain = [Runtime.InteropServices.Marshal]::PtrToStringBSTR([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pw)); $OutputEncoding = New-Object System.Text.UTF8Encoding $false
$plain | & "C:\Program Files\AIHostingPanel\node\node.exe" --env-file="C:\aihostingpanel\config\api.env" "C:\Program Files\AIHostingPanel\current\api\dist\cli.mjs" reset-password --username NAME
  1. Open PowerShell as Administrator on the server. The command reads the API's settings file, C:\aihostingpanel\config\api.env, which the installer writes. Only administrators can read it, and nobody prints it. Replace NAME with the sign-in name.

Android (Termux)

# 1. The sign-in names
(set -a; . "$HOME/aihostingpanel/config/aihostingpanel.env"; set +a; node "$AIHOSTINGPANEL_RELEASE_DIR/api/dist/cli.mjs" list-users)

# 2. The new password, typed when asked
read -rs PW && printf '%s\n' "$PW" | (set -a; . "$HOME/aihostingpanel/config/aihostingpanel.env"; set +a; node "$AIHOSTINGPANEL_RELEASE_DIR/api/dist/cli.mjs" reset-password --username NAME)
  1. Run in Termux on the phone. The command reads the phone panel's settings file itself. The installer writes AIHOSTINGPANEL_RELEASE_DIR into that file; it names the installed release folder. Replace NAME with the sign-in name.

Check it

  1. Sign in on the panel's sign-in page with the new password. The dashboard opens.
  2. Sign in with the old password. It fails.
  3. Open Audit Log. An auth.password.reset entry is there, with the account name and no password.
  4. Give the new password to the account's owner through the owner's password manager. Never in chat, a file or a report.

What we tested on 29 November 2026

  1. On the Android phone (Infinix X680B, Android 10, panel 1.2.52-termux.5): list-users showed the owner account; reset-password finished with exit code 0; the new password signed in (HTTP 200) and the session showed the owner role; a wrong password got HTTP 401; sign-out returned HTTP 204; the access token used before sign-out then got HTTP 401.
  2. On the phone, the command was tested in build 1.2.52-termux.5 on 29 November 2026, and it comes with the phone release that follows 1.2.54-termux.1. The phone's previous file is kept beside it, so it can be put back.
  3. The password was generated during the test and not kept, so nobody holds it. To sign in on that phone, run the reset command with a password you choose.
  4. On the PC: seven new tests of the reset in the API test suite. The whole suite passed: 1251 tests.

Limits

  1. The command runs only on the server, with the server's settings. The owner's own password can be reset only this way. An admin can reset another user's password on the Users page.
  2. It does not change two-factor sign-in, API tokens or other accounts. If the phone that makes the two-factor codes is lost, this command does not help: the owner must decide what to do.
  3. The command is in release 1.2.55 and every later release, including 1.2.58. On an older release, update the panel first.
  4. The panel can keep running during a reset: the account's sign-ins end at once, and no restart is needed.
  5. The Android app (APK 1.1.2) has no command line, so this command does not apply to it.

All posts