Pular para o conteúdo

Access recovery

When nobody can sign in to the console — a forgotten password, a locked account, a lost phone, or no administrator left — you recover access from the server itself. These commands run in the installation directory (/opt/okyouin on the appliance and the ISO install), over SSH or on the server’s console. The application must be running (./okyouin ps).

Every action is recorded in the audit log, with an actor such as cli-reset or cli-create-admin.

SituationCommand
An account is locked./okyouin unlock <user>
Someone forgot their password./okyouin reset-password <user>
No administrator can sign in at all./okyouin create-admin
A user lost the phone or authenticator./okyouin reset-mfa <user>

Repeated failed sign-ins lock an account. To see and clear locks:

Terminal window
./okyouin unlock # list locked console accounts
./okyouin unlock alice # unlock one account
./okyouin unlock --all # unlock every locked account
Terminal window
./okyouin reset-password alice

It sets a new generated password, prints it once, clears any lock, ends every session of the account and requires a new password at the next sign-in.

To choose the password instead, type it at a prompt (asked twice):

Terminal window
./okyouin reset-password alice --ask-password

In scripts, pass it on one line of standard input with --password-stdin. Either way the password never appears on a command line. (--password <value> also works but leaves the password in your shell history; a warning says so.)

When no administrator is left — deleted, disabled, or every password lost — this guarantees a working one:

Terminal window
./okyouin create-admin

Without a name it uses the initial administrator’s name from the install (INITIAL_ADMIN_USERNAME). It:

  • makes sure an administrators group exists;
  • creates the user if missing, or repairs it: enables and unlocks it and ends all its old sessions;
  • adds it to the administrators group;
  • sets a password — generated and printed — that must be changed at the next sign-in.

To create a separate administrator with an e-mail address and a password you choose:

Terminal window
./okyouin create-admin ops --email ops@example.com --ask-password
Terminal window
./okyouin reset-mfa alice

It removes all of the user’s MFA enrolments — active and pending — and their pending challenges. When e-mail is configured, the user is told by e-mail that MFA was removed. If their groups require MFA, the next sign-in asks them to set up a new method.

To send the user a new setup link right away:

Terminal window
./okyouin reset-mfa alice --send-setup-link

The same reset is available in the console on the user’s page, for administrators who can still sign in. See MFA.

These commands need a shell on the server. On the appliance and the ISO install that is the okyouin user, whose password was set in the first-boot wizard. If that password is lost too, use your hypervisor’s or Linux distribution’s standard procedure to reset a local password.

  • Keep at least two administrator accounts, each with its own second factor.
  • Keep the generated initial password out of .env: delete the INITIAL_ADMIN_PASSWORD line once you have signed in.
  • Keep SSH or console access to the server documented for your team: it is the way back in.