# ed machines host-keys

> Inspects the host-key fingerprints saved for a machine without opening an SSH connection, and optionally compares a SHA256 fingerprint you obtained through a…

- Canonical URL: https://getedith.pro/docs/cli/machines/host-keys
- Updated: 2026-12-02

Inspects the host-key fingerprints saved for a machine without opening an SSH
connection, and optionally compares a SHA256 fingerprint you obtained through a
trusted channel, such as the server's console.

```
ed machines host-keys <machine> [--fingerprint <SHA256:...>] [--json]
```

## Arguments

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `<machine>` | string, required | none | Saved machine name, SSH alias or id. |

## Options

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `--fingerprint` | `SHA256:` followed by 43 base64 characters | none | Fingerprint to compare with the saved records. |
| `--json` | flag | off | Emit the report as JSON. |
| `--help`, `-h` | flag | off | Print the help for this command and exit 0. |

## Behaviour

The command resolves the machine the same way Machines connects: its SSH config
alias or its manual host, port and user. `ssh -G` reports the effective host
name, port and `HostKeyAlias`, and `ssh-keygen -F` looks the name up in Edith's
known-host file, your `~/.ssh/known_hosts` and the global known-host files.
Hashed entries and `[host]:port` names for non-default ports work through
OpenSSH's own lookup. Nothing is added, replaced or removed, and no network key
scan runs. Both tools run with a fifteen second deadline.

JSON holds `lookup`, `status`, `observed`, `records` and `notes`. Each record has
`file`, `line`, `algorithm`, `fingerprint` and `marker` (empty, `CA` or
`REVOKED`). `observed` is null when you supplied no fingerprint.

| Status | Meaning |
| --- | --- |
| `saved` | Saved records were found and no fingerprint was supplied. |
| `match` | The supplied fingerprint equals an unmarked saved key. |
| `mismatch` | The supplied fingerprint differs from every unmarked saved key. |
| `notFound` | No saved record exists for the host. |
| `revoked` | A saved revoked key has the supplied fingerprint. |
| `authority` | Only certificate authority records were found. |

A finished review exits 0 for every status, so read `status` when scripting. A
malformed fingerprint, an unresolved SSH configuration or an unreadable record
exits 1. An unknown machine exits 3. Fingerprint equality is not a trust
decision. `KnownHostsCommand`, IP address records and certificate validity are
outside this file review.

In the app, the shield button in a machine's header opens **Host keys** with the
same records, copy buttons and a comparison field. When SSH rejects a changed
key, the connection error names the fingerprint SSH reported and the sheet
starts with it filled in.

## Examples

```
ed machines host-keys box
ed machines host-keys box --fingerprint 'SHA256:BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwc' --json
```

## Where to go next

- [`ed machines`](https://getedith.pro/docs/cli/machines), the rest of this group
- [All `ed` commands](https://getedith.pro/docs/cli)

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
