# ry ssh

> An interactive shell in a running machine (over the Rytiv API, no SSH needed); real SSH for IDEs: ry ssh config.

```text
ry ssh [options] [command] [app]
```

## Arguments

- `[app]`: The app (default: "app" from rytiv.json in this directory or above).

## Options

- `-m, --machine <id>`: Which machine (default: a running one of the app).
- `--no-wake`: Fail instead of waking a sleeping machine.

## Example

```bash
ry ssh dev-1
```

From `ry ssh --help`:

```text
Real SSH (VS Code Remote-SSH, scp, sftp, ssh -L) goes through the SSH gateway:
  ry ssh-keys add                 register ~/.ssh/id_ed25519.pub
  ry ssh config >> ~/.ssh/config  Host entries rytiv-<app>, host key pinned
  ssh <app>@ssh.<domain>          or ssh <app>.<machine>@...
  ry ssh token <app> --ttl 1h     a short-lived user name for CI and agents
Commands without a terminal: ry exec <app> -- <command>.
```

## Subcommands

### `ry ssh token`

Mint a short-lived SSH token for agents and CI: `ssh <token>@ssh.<domain>` (shown once).

```text
ry ssh token [options] <app>
```

Options:

- `-m, --machine <id>`: Bind the token to this machine (default: a running one at login).
- `--ttl <duration>`: Lifetime, e.g. 30m, 2h, 1d (default 1h, at most 72h).

Example:

```bash
ry ssh token web
```

### `ry ssh tokens`

The SSH tokens of this org that still work.

```text
ry ssh tokens [options] [command]
```

#### `ry ssh tokens list`

Tokens that are neither expired nor revoked, without their value.

```text
ry ssh tokens list [options]
```

Example:

```bash
ry ssh tokens list
```

#### `ry ssh tokens revoke`

Revoke an SSH token; the next login or channel with it is refused.

```text
ry ssh tokens revoke [options] <id>
```

Options:

- `-y, --yes`: Skip confirmation (required for automation).

Example:

```bash
ry ssh tokens revoke sst-1a2b3c4d
```

### `ry ssh config`

Print ~/.ssh/config entries (Host `rytiv-<app>`) for IDEs and pin the gateway's host key.

```text
ry ssh config [options] [apps...]
```

Options:

- `-i, --identity <file>`: The private key the entries should use (IdentityFile).

Example:

```bash
ry ssh config web
```
