# pw ssh known-hosts

> Source: https://parallelworks.com/docs/cli/pw/ssh/known-hosts

## pw ssh known-hosts

Print known_hosts lines for a resource from the platform's recorded host keys

### Synopsis

Print the host keys the platform recorded for a resource in known_hosts format,
for OpenSSH's **KnownHostsCommand**. **pw ssh configure** writes a config that
calls this with the key the server presented, so plain **ssh** verifies the
server the same way **pw ssh** does.

A presented key that matches a recorded SHA256 fingerprint is printed as well.
When nothing is recorded and the platform verification policy is **warn**, the
presented key is printed and the connection is reported as unverified. Under
**enforce** the command fails and ssh refuses the host.

```
pw ssh known-hosts [flags] <resource>
```

### Examples

```
  # What OpenSSH runs when connecting to a configured host
  pw ssh known-hosts --presented-type ssh-ed25519 --presented-key AAAAC3NzaC1lZDI1NTE5... pw://Jake.Thayne/my-cluster
```

### Options

```
  -h, --help                    help for known-hosts
      --presented-key string    Base64 host key the server presented (OpenSSH's %K)
      --presented-type string   Type of the host key the server presented (OpenSSH's %t)
```

### Options inherited from parent commands

```
      --context string         The context to use. Overrides PW_CONTEXT environment variable and current context from config.
      --platform-host string   The Parallel Works ACTIVATE platform host to use. Overrides PW_PLATFORM_HOST environment variable and the current context's server.
  -v, --verbose                Enable verbose logging
```

### SEE ALSO

* [pw ssh](/docs/cli/pw/ssh)	 - Initiate an SSH connection to a resource
