# arenaku11/anonssh architecture

> Architecture diagram of the GitHub repository arenaku11/anonssh, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arenaku11/anonssh
- Repository: https://github.com/arenaku11/anonssh

## Overview

anonssh is a single-process SSH client that routes its SSH connection through embedded Arti Tor. The principal workflow is to parse connection options, configure and bootstrap Tor, create an isolated connection, establish SSH, verify the host key, authenticate, then run a command or interactive terminal and return the remote status. The README also documents optional proxy and bridge transports, exit-country selection, key loading, and temporary or persistent Tor state. The runtime is concentrated in src/main.rs; unsampled implementation details are represented only where the README documents them.

Main entry points: [`src/main.rs`](https://github.com/arenaku11/anonssh/blob/main/src/main.rs) (CLI and orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Session setup"]
  node_main["CLI and orchestration<br/>[main.rs]"]
  node_result["Exit status<br/>[main.rs]"]
end

subgraph group_tor["Tor networking"]
  node_tor_config["Tor configuration<br/>[main.rs]"]
  node_tor_state[("Arti state<br/>[main.rs]")]
  node_arti["Arti client<br/>[main.rs]"]
  node_proxy["Upstream proxy"]
  node_bridges["Bridge transports"]
  node_tor_network["Tor network"]
end

subgraph group_ssh["SSH session"]
  node_ssh_server["SSH server"]
  node_ssh_profile["SSH profile<br/>[main.rs]"]
  node_host_key["Host verification<br/>[main.rs]"]
  node_auth["SSH authentication<br/>[main.rs]"]
  node_command["Remote command<br/>[main.rs]"]
  node_terminal["Interactive terminal<br/>[main.rs]"]
  node_io["Stream forwarding<br/>[main.rs]"]
end

node_user(("User"))

node_user -->|"supplies options"| node_main
node_main -->|"configures Tor"| node_tor_config
node_tor_config -->|"selects storage"| node_tor_state
node_main -->|"bootstraps and isolates"| node_arti
node_tor_config -->|"configures client"| node_arti
node_tor_config -.->|"configures proxy"| node_proxy
node_tor_config -.->|"configures bridges"| node_bridges
node_arti -->|"creates circuit"| node_tor_network
node_main -->|"connects through Tor"| node_arti
node_arti -->|"opens SSH stream"| node_ssh_server
node_main -->|"configures SSH"| node_ssh_profile
node_main -->|"verifies host key"| node_host_key
node_main -->|"authenticates"| node_auth
node_main -->|"opens command"| node_command
node_main -->|"opens terminal"| node_terminal
node_command -->|"forwards streams"| node_io
node_terminal -->|"forwards streams"| node_io
node_main -->|"returns status"| node_result

click node_main "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_tor_config "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_tor_state "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_arti "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_ssh_profile "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_host_key "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_auth "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_command "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_terminal "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_io "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"
click node_result "https://github.com/arenaku11/anonssh/blob/main/src/main.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_result,node_user toneBlue
class node_tor_config,node_tor_state,node_arti,node_proxy,node_bridges,node_tor_network toneAmber
class node_ssh_server,node_ssh_profile,node_host_key,node_auth,node_command,node_terminal,node_io toneMint
```

## Components

### Session setup

- [CLI and orchestration](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`
- [Exit status](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`

### Tor networking

- [Tor configuration](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`
- [Arti state](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`
- [Arti client](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`
- **Upstream proxy**
- **Bridge transports**
- **Tor network**

### SSH session

- **SSH server**
- [SSH profile](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`
- [Host verification](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`
- [SSH authentication](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`
- [Remote command](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`
- [Interactive terminal](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`
- [Stream forwarding](https://github.com/arenaku11/anonssh/blob/main/src/main.rs): `src/main.rs`

### Other components

- **User**

## Connections

- User → CLI and orchestration: supplies options (evidence: `README.md`)
- CLI and orchestration → Tor configuration: configures Tor (evidence: `README.md`)
- Tor configuration → Arti state: selects storage (evidence: `README.md`)
- CLI and orchestration → Arti client: bootstraps and isolates (evidence: `README.md`)
- Tor configuration → Arti client: configures client (evidence: `README.md`)
- Tor configuration → Upstream proxy: configures proxy (evidence: `README.md`)
- Tor configuration → Bridge transports: configures bridges (evidence: `README.md`)
- Arti client → Tor network: creates circuit (evidence: `README.md`)
- CLI and orchestration → Arti client: connects through Tor (evidence: `src/main.rs`)
- Arti client → SSH server: opens SSH stream (evidence: `README.md`)
- CLI and orchestration → SSH profile: configures SSH (evidence: `README.md`)
- CLI and orchestration → Host verification: verifies host key (evidence: `README.md`)
- CLI and orchestration → SSH authentication: authenticates (evidence: `README.md`)
- CLI and orchestration → Remote command: opens command (evidence: `README.md`)
- CLI and orchestration → Interactive terminal: opens terminal (evidence: `README.md`)
- Remote command → Stream forwarding: forwards streams (evidence: `README.md`)
- Interactive terminal → Stream forwarding: forwards streams (evidence: `README.md`)
- CLI and orchestration → Exit status: returns status (evidence: `README.md`)
