Metadata-Version: 2.5
Name: ssh-over-sse-cli
Version: 0.1.0
Summary: OpenSSH ProxyCommand client for ssh-sse/v1
Requires-Python: >=3.12
Requires-Dist: cryptography>=45
Requires-Dist: httpx<1,>=0.28
Requires-Dist: pyyaml<7,>=6
Description-Content-Type: text/markdown

# ssh-sse-cli

Connect to SSH servers through an HTTPS gateway with your usual OpenSSH commands.

## Install

Requires Linux or macOS, Python 3.12 or newer, and OpenSSH.

With uv:

```sh
uv tool install --python 3.12 ssh-over-sse-cli
```

Or with pip:

```sh
pip install 'ssh-over-sse[cli]'
```

Use `ssh-over-sse[all]` with pip to install the gateway command too.
Supported keys are Ed25519, RSA (2048–8192 bits), and ECDSA (P-256, P-384, P-521).
Load encrypted keys into `ssh-agent` before use.

## Configure SSH

Ask your administrator for the gateway URL and an allowed destination. Add an
entry to your SSH configuration, replacing the example values:

```sshconfig
Host my-server
    HostName 192.0.2.20
    Port 22
    User alice
    IdentityFile ~/.ssh/id_ed25519
    IdentitiesOnly yes
    StrictHostKeyChecking yes
    ProxyCommand ssh-sse-cli --url https://gateway.example.com --ssh-host %n
```

Connect or transfer files normally:

```sh
ssh my-server
scp report.txt my-server:report.txt
sftp my-server
```

The client reads the destination, port, SSH user, and first available identity
from the selected host. `--target`, `--user`, and `-i` override those values.
If you use `ssh -F`, pass the same file using `--ssh-config` in the ProxyCommand.
To pass outer command-line user or port overrides, add `--user %r --target %h:%p`.

Your public key must be authorized by the gateway account and destination server.
Your private key stays on your computer. Keep SSH host-key verification enabled.

## Check your key

Open the gateway URL in a browser to view the landing page. Then run:

```sh
ssh-sse-cli --url https://gateway.example.com check
```

Without a host alias, the identity defaults to `~/.ssh/id_ed25519`. To select a
key or use an existing SSH host's identity:

```sh
ssh-sse-cli --url https://gateway.example.com -i ~/.ssh/id_ecdsa check
ssh-sse-cli --url https://gateway.example.com --ssh-host my-server check
```

The check requires no destination or SSH user. It verifies gateway access without
connecting to a destination. Success prints
`Gateway SSH key authentication succeeded.` and exits with status 0. Errors exit
with status 1. HTTP 401 means the key was rejected; HTTP 500 indicates a gateway
or server error.

For a direct backend check, use its HTTP address:

```sh
ssh-sse-cli --url http://192.0.2.10:7010 -i ~/.ssh/id_ecdsa check
```

SSH connections use the public HTTPS URL. A successful key check does not confirm
destination permissions or the destination's SSH login.

## Options

| Option | Purpose |
| --- | --- |
| `--url` | Gateway root URL |
| `--ssh-host` | Read connection and identity settings from an SSH host alias |
| `--ssh-config` | Read an alternate SSH configuration file |
| `--target` | Override the destination as `HOST:PORT`; bracket IPv6 addresses |
| `--user` | Override the destination SSH username |
| `-i`, `--identity` | Select an identity file |
| `--config` | Read client settings from a file |
| `--ca-file` | Trust a private HTTPS certificate authority |
| `--log-level` | Set diagnostics to `DEBUG`, `INFO`, `WARNING`, or `ERROR` |

Client settings default to `~/.config/ssh-over-sse/client.yaml` when that file
exists. Store your gateway URL there to omit `--url`:

```yaml
url: https://gateway.example.com
```

Command-line options take precedence. Connection diagnostics appear on stderr;
`check` prints its success message on stdout.

## Troubleshooting

If authentication fails, check the URL, selected key, and gateway authorization.
For encrypted keys, check that the identity is loaded into `ssh-agent`. Ask your
administrator to confirm destination permissions if the key check succeeds but
SSH cannot connect. After an interruption, start a new connection.

```sh
ssh-sse-cli --help
```
