Skip to content

Users and sign in

Edward Baitsewe edited this page Nov 9, 2026 · 1 revision

Users and sign in

Everyone who uses the control panel has their own account and their own two-factor. No shared logins.

Roles

Role Who
Site owner The client. Edits their own site.
Administrator Monate Media. Looks after the site, updates and recovery.

hammer install makes the first user an administrator. user:create makes site owners unless told otherwise.

Welcome links: nobody types a password on the server

Accounts never start with a password. install, user:create and user:reset print a welcome link instead. The person opens it, chooses their own password, and sets up two-factor. So:

  • shared hosts, which cannot hide a password typed on the command line, never see one;
  • Monate Media never knows a client's password;
  • a link works for 72 hours, once, and a newer link replaces an older one.
php hammer user:create --email=client@example.com --name="Client Name"
php hammer user:create --email=colleague@monatemedia.com --name="Colleague" --role=admin

Send the link it prints to the person, by whatever channel you trust.

Signing in

  1. Email address and password. At least 12 characters. A few words in a row works well.
  2. A six-digit code from an authenticator app on their phone. Or, without the phone, one of their recovery codes, typed in the same box.

Setting up two-factor (first sign-in)

Two-factor is required for everyone, so the first sign-in sets it up:

  1. Open Google Authenticator (free for iPhone and Android). Any other authenticator app works too.
  2. In the app, tap + → Scan a QR code, and scan the code on the page. Scan from inside the app, not with the phone's camera: on an iPhone the camera offers to save the code in Passwords instead (which also works, if the person prefers it). No camera? Enter a setup key and type the key shown under the QR code.
  3. Type the six-digit code the app shows.

The page then shows eight recovery codes, once. Download saves them as a text file. Each signs in once, in place of the six-digit code.

Lost phone, forgotten password

php hammer user:reset --email=client@example.com

This clears the password, two-factor and recovery codes, signs the person out everywhere, and prints a new welcome link. They start again from the welcome page. Remind them to delete the old entry from their authenticator app.

What keeps it safe

  • Passwords are stored with Argon2id (bcrypt on a PHP without it).
  • Codes cannot be used twice; recovery codes are single-use and stored as hashes.
  • Guessing is slowed down: five wrong passwords for one address, or twenty from one IP address, or five wrong codes, means a 15-minute wait.
  • Sessions live in the database, get a new token at every sign-in, and end after two hours without activity or twelve hours in all. Only a hash of the cookie is stored.
  • Every form carries a token, so another website cannot act for someone signed in.
  • The pages run under a strict Content Security Policy: no inline scripts or styles, nothing from other sites.
  • An audit log records sign-ins, failed sign-ins, password and two-factor changes, and resets.

Other commands

php hammer migrate     # bring the database up to date (install does this too)

Clone this wiki locally