An agent needs no email address, no licence and no registration. There are two ways to enrol one. Choose by which side can reach the other.
| Situation | Use |
|---|---|
| The master can connect to the agent | Pairing code |
| The agent is behind NAT or a firewall, and can only connect out | Token one-liner |
Before adding a remote agent, make sure the master has
advertise_addr
set and ports 8443 and 8444 open.
On the agent host:
curl -fsSL https://trcr.dev/install/install.sh | sh -s -- --agentThis installs trcrd, creates the trcr service account, and starts the agent
in a waiting state, listening on port 8445. The install ends by printing a
pairing code and a fingerprint:
Pairing code: K7QM-3XWD
Fingerprint: sha256:9f2c…e1
On the master, using the agent's address and those two values:
sudo trcrd enroll-agent 203.0.113.7 --code K7QM-3XWD --fingerprint sha256:9f2c…e1The master first confirms that the host answering at that address holds the key
behind the fingerprint. A wrong host gets nothing, not even the code. The
command waits until the agent has reported in (60 seconds by default; change it
with --timeout) and prints enrolled <name>.
As soon as enrolment succeeds, the agent deletes the pairing code and closes port 8445 for good.
Useful options and facts:
--accept-from IP[,IP]on the install accepts enrolment only from those master addresses. For automated rollouts it can also replace the code. Only rely on that inside a network where those addresses cannot be used by anyone else, and keep--fingerprintin every case.--bootstrap-port Nchanges the port. Then useenroll-agent IP:Non the master.--open-firewallopens the port in firewalld or ufw. Without it the installer prints the command. The firewall rule does not close by itself, so the installer also prints the command to remove it afterwards.- Lost the code? On the agent,
sudo trcrd join --pending --show-codeprints the code and fingerprint again. Re-running the installer on a waiting agent prints the same ones. - Repeated wrong codes are blocked for a short time.
On the master:
sudo trcrd enroll-agentIt prints one command with a token included. Run that command on the agent host:
curl -fsSL https://trcr.dev/install/install.sh | sh -s -- \
--join trcr-master.example.com:8444 \
--token TRCR-ENROLL-1.… \
--ca-hash sha256:…On a host that had nothing installed, this installs trcrd, enrols, writes
/etc/trcr/agent.yaml, creates the service account, installs the service and
starts it.
- The agent's name defaults to its hostname, in lower case. Pass
--node-idtoenroll-agentto choose a name. - Tokens work once and expire after one hour by default. Change that with
--expires. --ca-hashis what makes enrolment safe. It tells the agent which master to trust.enroll-agentalways includes it; do not remove it.- If
trcrdis already on the host,enroll-agentalso prints the plaintrcrd join …form. - Pasting the same line twice is harmless. On an agent that is already enrolled it only makes sure the service is installed and running.
On the master:
sudo trcrd agentsA new agent should show up within a minute. The states are:
| State | Meaning |
|---|---|
up |
Reporting normally. |
down |
Was reporting, and has been silent for longer than the limit (90 seconds by default). |
never-seen |
Enrolled, but has never made a successful call. See Troubleshooting. |
revoked |
Trust withdrawn. Listed with --all. |
trcrd agents reads saved state, so it works even when the master is stopped.
--json gives output for scripts. --stale lists only agents that are not
reporting and exits with status 1 if there are any:
trcrd agents --stale || echo "an agent is not reporting"As soon as two agents are enrolled, the master creates a ping between every
pair, in both directions, named mesh-<a>-to-<b>. These feed the Agent Mesh
and Agent-to-Agent dashboards. They appear in trcrd probes marked
auto-mesh, which shows where they came from and is not a licence bundle. They
are not written to your configuration files.
master:
agents:
auto_mesh: true # set false to turn these off
auto_mesh_interval: 60sEach probe can say which agents run it. See Probes.
On the agent:
sudo trcrd leaveThen enrol it with the new master in either of the two ways above.
trcrd leave tells the old master first, while the agent's certificate still
works, then stops the service and deletes the agent's certificate and
agent.yaml. If the master cannot be reached, nothing is deleted. For a
master that is gone for good, use --local-only. --keep-config keeps
agent.yaml.
trcrd join refuses to run on a host that is already enrolled:
trcrd join: config /etc/trcr/agent.yaml already exists; pass --force to overwrite
agent already enrolled at /var/lib/trcr/agent; pass --force to re-enroll (destructive)
This is a local check, not a network problem. Prefer trcrd leave. Use
--force only for an enrolment that is stale or never completed. To see which
master a host belongs to:
grep master_addr /etc/trcr/agent.yamlIf you rebuilt the master and paste a new one-liner on an old agent, the agent
notices the different --ca-hash and enrols again.
sudo trcrd agents revoke <name> # on the master: stop trusting it, keep the record
sudo trcrd agents remove <name> # on the master: delete the record
sudo trcrd leave # on the agent: undo the enrolmentRevoking takes effect on a running master within seconds, with no restart. A revoked agent is refused on its next call, even though its certificate has not expired.
revokekeeps the record, so you can see later that the agent was retired. The name can be used again: enrolling under it issues a new certificate. The old certificate does not start working again.removedeletes the record and frees the name.- Neither command touches the agent host.