vectory-admin
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-admintakes 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 samedatavolume as UID 10001. invalidate-restored-access,recover-generationsandretire-device-capreview first. Add--applyto make the change. Every applied change is recorded in the audit log. The other commands that change data, such asreset-passwordanddisable-mfa, act at once, as their sections say.
vectory-admin --help lists the commands.
Commands
Section titled “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. |
invalidate-restored-access
Section titled “invalidate-restored-access”A restored backup brings back old sessions, reset links, recovery codes and tokens. This command removes them in one step.
vectory-admin --data-dir /var/lib/vectory invalidate-restored-accessvectory-admin --data-dir /var/lib/vectory invalidate-restored-access --applyThe 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.
generation-recovery-state
Section titled “generation-recovery-state”Export the devices and their counters as JSON, for review.
vectory-admin --data-dir /var/lib/vectory generation-recovery-state > report.jsonThe counters in the export are null on purpose, so an unreviewed report can’t be applied. Fill them in as described next.
recover-generations
Section titled “recover-generations”Devices remember the highest configuration generation they accepted and refuse anything older. After restoring an older backup, raise the server’s counters above theirs.
-
For each device, read its counters on the host with
sudo vectory status --json:state.highest_generation,state.highest_policy_generationandstate.secret_revision. -
In
report.json, fill inhighest_generation,highest_policy_generationandhighest_secret_revision(fromsecret_revision) for each device. Leave nothingnull. -
Preview, then apply:
Terminal window vectory-admin --data-dir /var/lib/vectory recover-generations --report report.jsonvectory-admin --data-dir /var/lib/vectory recover-generations --report report.json --apply -
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.
rotate-signing-key
Section titled “rotate-signing-key”Create a new key for signing device manifests.
vectory-admin --data-dir /var/lib/vectory rotate-signing-keyNew 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.
prune-signing-keys
Section titled “prune-signing-keys”Delete old signing keys that no unexpired, unrevoked credential still uses.
vectory-admin --data-dir /var/lib/vectory prune-signing-keysAt most four old keys are kept. Never delete a key by hand just because a newer one exists.
device-ca-status
Section titled “device-ca-status”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.
vectory-admin --data-dir /var/lib/vectory device-ca-statusSettings → General shows the same while the server runs.
rotate-device-ca
Section titled “rotate-device-ca”Create a new device CA. The current one becomes the previous one and stays trusted, so every enrolled device keeps working.
vectory-admin --data-dir /var/lib/vectory rotate-device-caIt 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.
retire-device-ca
Section titled “retire-device-ca”Stop trusting the previous device CA once no device needs it.
vectory-admin --data-dir /var/lib/vectory retire-device-cavectory-admin --data-dir /var/lib/vectory retire-device-ca --applyThe 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.
reset-password
Section titled “reset-password”Create a single-use password reset link when no administrator can sign in:
vectory-admin --data-dir /var/lib/vectory reset-password \ --email admin@example.com --url https://vectory.example.comIt 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.
disable-mfa
Section titled “disable-mfa”Turn off two-factor sign-in for an account whose authenticator and recovery codes are both lost.
vectory-admin --data-dir /var/lib/vectory disable-mfa --email admin@example.comThe 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.