Connecting an agent
Enrollment is a three-step process:
- Create an enrollment token on the server.
- Install the agent on the host.
- Agent registers on first boot and receives a client certificate.
1. Create an enrollment token
tyr enrollment-token create --label "laptops-2026-q2" --max-uses 50 --expires-hours 168Output:
enrollment token: tyr_et_a8d7f3e2c1b9... label: laptops-2026-q2 max_uses: 50 expires_at: 2026-04-27T10:45:02Z
Store this value — it will not be displayed again.Token hygiene:
- Short TTLs by default — treat them like one-time passwords.
- One token per fleet/environment (
laptops,ci-runners,prod-workers) so you can revoke independently. - The token is hashed (argon2id) on the server — you get the plaintext only once.
2. Install the agent
On the target host:
curl -sSL https://raw.githubusercontent.com/terranchi/tyr/main/scripts/install.sh \ | sudo bash -s -- \ --component agent \ --server https://tyr.example.com:7700 \ --token tyr_et_a8d7f3e2c1b9... \ --name $(hostname)What it does:
- Downloads the
tyr-<arch>-linux.tar.gzmatching your kernel architecture. - Installs
/usr/local/bin/tyrdand/usr/local/bin/tyr. - Writes
/etc/tyr/tyrd.yaml(config) with the token. - Installs
/etc/systemd/system/tyr-agent.service, enables and starts it.
3. Verify
-
On the agent host:
Terminal window sudo systemctl status tyr-agentsudo journalctl -u tyr-agent -fYou should see
enrollment succeededandpolicy loaded. -
From anywhere with CLI access:
Terminal window tyr agent listOutput:
ID NAME STATUS LAST_SEEN4f27e3c1-ab89-... my-host online 5s ago -
Tail live events to confirm:
Terminal window tyr audit tail --agent my-host
What happens under the hood
sequenceDiagram participant T as tyrd (first boot) participant S as tyr-server T->>S: 1. register(agent_name, csr, token) Note over S: validates token, signs CSR S-->>T: 2. cert + agent_id T->>S: 3. gRPC stream with mTLSThe enrollment token is consumed (uses incremented by 1). The agent persists its key + certificate to /var/lib/tyr/, so subsequent restarts re-use the same identity.
Re-enrolling
If /var/lib/tyr/ is wiped, the agent will attempt re-enrollment. You’ll need a valid token again. If you want to force a fresh identity:
sudo systemctl stop tyr-agentsudo rm -rf /var/lib/tyr/*sudo systemctl start tyr-agent # uses token from /etc/tyr/tyrd.yaml→ Next: Writing policies · Agents concept