Trust host key
trust_hostScan a host for SSH keys and add them to known_hosts so non-interactive SSH skips the trust prompt; existing entries are replaced safely.
Instructions
Fetch a host's keys (ssh-keyscan) and add them to known_hosts.
The inverse of forget_host: afterwards a non-interactive ssh to the host won't stop on the trust prompt. Existing entries for the host are replaced, so it's safe to re-run after a key change. A host that returns no keys leaves known_hosts untouched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Alias from ~/.ssh/config (its hostname and port are scanned) or a hostname/IP. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| added | Yes | keys added; 0 — the host returned none | |
| target | Yes | host name that was scanned | |
| known_hosts_file | Yes |