> ## Documentation Index
> Fetch the complete documentation index at: https://docs.machine0.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SSH Keys

> CLI reference for managing SSH keys.

## keys ls

```bash theme={"theme":"css-variables"}
machine0 keys ls
machine0 keys ls --json
```

***

## keys get

```bash theme={"theme":"css-variables"}
machine0 keys get <key> [flags]
```

| Flag          | Description                            |
| ------------- | -------------------------------------- |
| `--download`  | Download private key to `SSH_KEY_PATH` |
| `-f, --force` | Overwrite existing file                |

***

## keys new

```bash theme={"theme":"css-variables"}
machine0 keys new <key> [flags]
```

| Flag              | Description                                |
| ----------------- | ------------------------------------------ |
| `--type`          | **Required.** `MANAGED` or `PUBLIC`        |
| `--publicKeyPath` | Path to public key (required for `PUBLIC`) |
| `--default`       | Set as default key for new VMs             |

```bash theme={"theme":"css-variables"}
machine0 keys new my-key --type MANAGED --default
machine0 keys new my-key --type PUBLIC --publicKeyPath ~/.ssh/id_ed25519.pub
```

Managed keys save the private key to `~/.ssh/machine0__<name>`.

***

## keys update

```bash theme={"theme":"css-variables"}
machine0 keys update <key> [flags]
```

| Flag        | Description                     |
| ----------- | ------------------------------- |
| `--default` | Set as default (`true`/`false`) |

***

## keys rm

```bash theme={"theme":"css-variables"}
machine0 keys rm <key> [flags]
```

| Flag        | Description       |
| ----------- | ----------------- |
| `-y, --yes` | Skip confirmation |
