Skip to content
VectoryHelp center
Home

vectory-admin

View Markdown

Copy page as Markdown

Clipboard access is unavailable. The complete page is selected below. Copy it using your keyboard or device menu, or download the Markdown file.

Download Markdown

vectory-admin is the offline maintenance tool for a Vectory server. Use it after restoring a backup, to rotate signing keys and the device certificate authority, and for break-glass account recovery.

vectory-admin --data-dir PATH <command> [flags]
  • Stop the server first. vectory-admin takes the same exclusive lock on the data directory and refuses to run next to a live server.
  • Run it as the server’s operating-system account, against the server’s data directory. The Compose image includes it at /usr/local/bin/vectory-admin; run it in a one-off container that mounts the same data volume as UID 10001.
  • invalidate-restored-access, recover-generations and retire-device-ca preview first. Add --apply to make the change. Every applied change is recorded in the audit log. The other commands that change data, such as reset-password and disable-mfa, act at once, as their sections say.

vectory-admin --help lists the commands.

Command What it does
invalidate-restored-access After a restore, end every session, revoke reset links, recovery codes and enrollment tokens, and stop agent updates.
generation-recovery-state Export each device’s configuration counters for review after a restore.
recover-generations Raise configuration counters above what devices already accepted, from a reviewed report.
rotate-signing-key Create a new manifest signing key.
prune-signing-keys Delete old signing keys that no valid device credential still uses.
device-ca-status Show the device certificate authorities and which devices still use the previous one.
rotate-device-ca Create a new device certificate authority; the current one stays trusted as the previous one.
retire-device-ca Stop trusting the previous device certificate authority once no device uses it.
reset-password Create a single-use password reset link for an account.
disable-mfa Turn off two-factor sign-in for an account that lost its authenticator.

A restored backup brings back old sessions, reset links, recovery codes and tokens. This command removes them in one step.

Terminal window
vectory-admin --data-dir /var/lib/vectory invalidate-restored-access
vectory-admin --data-dir /var/lib/vectory invalidate-restored-access --apply

The first command shows counts only. With --apply it signs out every browser session, deletes all password reset links and two-factor recovery codes, and revokes all enrollment and device-recovery tokens. Passwords, roles, authenticators, devices and deployments stay as restored.

With agent updates on, --apply also does Stop all updates, as a local administrator. It cancels every active or paused update rollout, withdraws every offer and refuses new rollouts until an administrator reviews the release keys, the releases and the rollouts and chooses Clear the stop in Settings → Agent updates. The counts show how many rollouts it will cancel (agent_update_rollouts_to_cancel) and whether it will set the stop (agent_update_stop). With updates off, or with a stop already set, it changes nothing about them.

Export the devices and their counters as JSON, for review.

Terminal window
vectory-admin --data-dir /var/lib/vectory generation-recovery-state > report.json

The counters in the export are null on purpose, so an unreviewed report can’t be applied. Fill them in as described next.

Devices remember the highest configuration generation they accepted and refuse anything older. After restoring an older backup, raise the server’s counters above theirs.

  1. For each device, read its counters on the host with sudo vectory status --json: state.highest_generation, state.highest_policy_generation and state.secret_revision.

  2. In report.json, fill in highest_generation, highest_policy_generation and highest_secret_revision (from secret_revision) for each device. Leave nothing null.

  3. Preview, then apply:

    Terminal window
    vectory-admin --data-dir /var/lib/vectory recover-generations --report report.json
    vectory-admin --data-dir /var/lib/vectory recover-generations --report report.json --apply
  4. Start the server and confirm fresh check-ins before you resume rollouts.

The report looks like this:

{
"devices": [{
"device_id": "THE-EXISTING-DEVICE-UUID",
"highest_generation": 42,
"highest_policy_generation": 19,
"highest_secret_revision": 7,
"expected_version_id": "THE-REVIEWED-VERSION-ID-OR-NULL",
"expected_sha256": "THE-REVIEWED-ARTIFACT-SHA256-OR-NULL",
"expected_policy_sha256": "THE-EXPORTED-CANONICAL-POLICY-SHA256"
}]
}

Use null for the version and artifact fields of a device with no pipeline. The whole operation stops if any device is unknown or revoked, appears twice, has a missing counter, or doesn’t match the reviewed version and policy. Each refusal names the device, and one for a counter that is still null also names the counter and says to read it with sudo vectory status --json on the device. --apply moves each counter one past the value you supplied, resets rollout evidence for those devices and records the change.

Create a new key for signing device manifests.

Terminal window
vectory-admin --data-dir /var/lib/vectory rotate-signing-key

New enrollments and renewed credentials use the new key. Existing devices keep their current key until their next certificate renewal, so keep keys/signing-history/ with the database. Back up before you rotate.

Delete old signing keys that no unexpired, unrevoked credential still uses.

Terminal window
vectory-admin --data-dir /var/lib/vectory prune-signing-keys

At most four old keys are kept. Never delete a key by hand just because a newer one exists.

Show the device certificate authority (CA) that issues device certificates, the previous one while it’s still trusted, and the devices that still hold certificates from it.

Terminal window
vectory-admin --data-dir /var/lib/vectory device-ca-status

Settings → General shows the same while the server runs.

Create a new device CA. The current one becomes the previous one and stays trusted, so every enrolled device keeps working.

Terminal window
vectory-admin --data-dir /var/lib/vectory rotate-device-ca

It prints both fingerprints and how many devices hold certificates from the previous CA. New enrollments and renewals get certificates from the new CA. Each device moves when it renews, in its certificate’s last day, so every device has moved within 30 days. The manifest signing key doesn’t change. There’s one previous CA at a time: retire it before you rotate again. See Rotate the device certificate authority.

Stop trusting the previous device CA once no device needs it.

Terminal window
vectory-admin --data-dir /var/lib/vectory retire-device-ca
vectory-admin --data-dir /var/lib/vectory retire-device-ca --apply

The first command only checks. Both refuse, exit 1 and name the devices while any unrevoked device still holds a valid certificate from the previous CA. A device that just renewed keeps its old certificate as a fallback for 24 hours, so it counts until then. With --apply, the previous CA is removed; from the next start the server refuses certificates it issued.

Create a single-use password reset link when no administrator can sign in:

Terminal window
vectory-admin --data-dir /var/lib/vectory reset-password \
--email admin@example.com --url https://vectory.example.com

It prints a link and the bare code, valid for 1 hour. Start the server again, then send the link through a trusted channel. The person opens it, or chooses Forgot password? on the sign-in page and pastes the code. On an account with two-factor sign-in it stays on, and the command says so; if the authenticator is lost too, also run disable-mfa.

Turn off two-factor sign-in for an account whose authenticator and recovery codes are both lost.

Terminal window
vectory-admin --data-dir /var/lib/vectory disable-mfa --email admin@example.com

The person can then sign in with their password and set up a new authenticator. Their sessions are signed out, and the change is recorded in the audit log. On an account without two-factor sign-in, the command changes nothing and exits 1.