{"id":48577635,"url":"https://github.com/finch-xu/remotettys","last_synced_at":"2026-04-14T16:00:50.104Z","repository":{"id":350016629,"uuid":"1204942977","full_name":"finch-xu/RemoteTTYs","owner":"finch-xu","description":"Remotely access the terminal on your home Mac from a browser, no NAT traversal needed. Run Claude Code, Codex, vim, or any CLI tool and command directly.","archived":false,"fork":false,"pushed_at":"2026-04-08T15:45:50.000Z","size":442,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-08T16:32:25.434Z","etag":null,"topics":["claude-code","cli","codex","ghostty","ghostty-terminal","remote-terminal","terminal","tty","web-terminal"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/finch-xu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-08T13:36:41.000Z","updated_at":"2026-04-08T15:46:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/finch-xu/RemoteTTYs","commit_stats":null,"previous_names":["finch-xu/remotettys"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/finch-xu/RemoteTTYs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finch-xu%2FRemoteTTYs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finch-xu%2FRemoteTTYs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finch-xu%2FRemoteTTYs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finch-xu%2FRemoteTTYs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/finch-xu","download_url":"https://codeload.github.com/finch-xu/RemoteTTYs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finch-xu%2FRemoteTTYs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31803790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","cli","codex","ghostty","ghostty-terminal","remote-terminal","terminal","tty","web-terminal"],"created_at":"2026-04-08T16:03:07.005Z","updated_at":"2026-04-14T16:00:50.098Z","avatar_url":"https://github.com/finch-xu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/logo.png\" width=\"300\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eRemoteTTYs\u003c/h1\u003e\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Go](https://img.shields.io/badge/Go-1.26-00ADD8?logo=go\u0026logoColor=white)](agent/go.mod)\n[![Node.js](https://img.shields.io/badge/Node.js-24+-339933?logo=node.js\u0026logoColor=white)](packages/relay/package.json)\n[![React](https://img.shields.io/badge/React-19-61DAFB?logo=react\u0026logoColor=black)](packages/web/package.json)\n[![Docker](https://img.shields.io/badge/Docker-ready-2496ED?logo=docker\u0026logoColor=white)](Dockerfile)\n[![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey)]()\n\nRemotely access the terminal on your home PC/Mac from a browser, no NAT traversal needed. Run Claude Code, Codex, vim, or any CLI tool and command directly.\n\n\u003e ⚠️ **Warning**: This project is for personal use and experimentation only — do NOT deploy it in production environments. You are solely responsible for securing your own data and connections. When exposing the relay to the public internet, always use a reverse proxy with HTTPS (e.g. [Caddy](https://caddyserver.com/)) to encrypt all traffic.\n\n**[中文 README](README.zh-CN.md)** | [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/finch-xu/RemoteTTYs) | **[English Docs](https://finch-xu.github.io/docs/remotettys/)** | **[中文文档](https://finch-xu.github.io/docs/zh/remotettys/)**\n\n\u003cimg src=\"images/meme.jpg\" width=\"400\" /\u003e\n\n## Screenshots\n\n\u003cp\u003e\n  \u003cimg src=\"images/screenshot-terminal.png\" width=\"720\" /\u003e\n\u003c/p\u003e\n\u003cp\u003e\n  \u003cimg src=\"images/screenshot-settings.png\" width=\"720\" /\u003e\n\u003c/p\u003e\n\n## How It Works\n\n```\nLocal Machine(s)              Remote Server                Browser(s)\n┌──────────────┐             ┌──────────────┐            ┌──────────┐\n│  rttys-agent │──outbound──▶│  rttys-relay │◀───HTTPS───│ Web UI   │\n│  (Go binary, │   WSS       │  (Node.js)   │   + WSS    │ ghostty  │\n│   no open    │◀────────────│              │───────────▶│  -web    │\n│   ports)     │             └──────────────┘            └──────────┘\n└──────────────┘\n```\n\n- **Agent** runs on your local machines and connects outbound to the relay — no open ports, no NAT traversal needed\n- **Relay** routes messages between agents and browsers without ever reading terminal content\n- **Web UI** renders terminals using [ghostty-web](https://github.com/coder/ghostty-web) (Ghostty's VT100 parser compiled to WebAssembly)\n\n## Features\n\n- No NAT traversal, no remote desktop, no remote AI tool — just remote your terminal\n- macOS, Linux, Windows full platform support\n- Multiple machines in one dashboard with online/offline status\n- Scrollback replay on browser reconnect (1MB buffer per session)\n- Multi-user authentication with JWT (httpOnly cookie + CSRF protection)\n- End-to-end encryption (ECDH P-256 + AES-256-GCM) — relay cannot read terminal content\n- Ed25519 challenge-response for server identity verification\n- Agent identity keys with TOFU (SSH-like trust model) for MITM protection\n- Machine fingerprint binding to prevent token reuse across machines\n- Audit logging (login, connections, session lifecycle)\n- Single Go binary agent — zero dependencies on target machines\n- Daemon mode with auto-reconnect (exponential backoff)\n\n## Deploy the Server\n\nThe server (relay + web UI) runs as a single Docker container.\n\n```bash\ngit clone https://github.com/finchxu/RemoteTTYs.git\ncd RemoteTTYs\ndocker compose up -d\n```\n\nThe server starts on port 8080. On first visit, you'll be guided through a setup page to create your admin account.\n\n\u003e Use a reverse proxy (Caddy, nginx) for HTTPS termination in production. Agents connect via `wss://`.\n\n### LAN Deployment (no SSL)\n\nIf you're running on a local network without HTTPS, create a `.env` file:\n\n```bash\ncp .env.example .env\n```\n\nEdit `.env`:\n\n```\nNODE_ENV=development\nJWT_SECRET=your-random-secret-here\n```\n\nThe Docker image sets `NODE_ENV=production` by default, which enables the `Secure` flag on cookies — browsers will refuse to send cookies over plain HTTP. Setting `NODE_ENV=development` disables this flag so authentication works over `http://`.\n\n\u003e **Note:** `JWT_SECRET` must be set explicitly for LAN deployments — in development mode without it, a random secret is generated on each restart, which means all users get logged out whenever the container restarts.\n\nThe agent should connect with `ws://` instead of `wss://`:\n\n```yaml\nrelay: ws://192.168.1.100:8080/ws/agent\n```\n\n## Install the Agent\n\nThe agent is a single Go binary that runs on your local machines.\n\n### 1. Download\n\nGo to the [Releases](https://github.com/finchxu/RemoteTTYs/releases) page and download the binary for your platform:\n\n| Platform | File |\n|----------|------|\n| macOS (Apple Silicon) | `rttys-agent-macOS-arm64` |\n| macOS (Intel) | `rttys-agent-macOS-x64` |\n| Linux (x86_64) | `rttys-agent-Linux-x64` |\n| Linux (ARM64) | `rttys-agent-Linux-arm64` |\n| Windows (x86_64) | `rttys-agent-Windows-x64.exe` |\n\n**macOS / Linux:**\n\n```bash\nchmod +x rttys-agent-*\nmv rttys-agent-* rttys-agent\n```\n\n**Windows:** No extra steps — run the `.exe` directly.\n\n### 2. Configure\n\n```bash\n./rttys-agent init\n```\n\nThis creates `config.yaml` in the same directory as the binary:\n\n```yaml\nrelay: wss://your-server.com/ws/agent\ntoken: your-agent-token\nserver_key: \u003cbase64-encoded-server-public-key\u003e\nname: my-machine\nshell: /bin/zsh\n```\n\n- **token**: Create an agent token in the web UI (Settings page) and paste it here.\n- **server_key**: Copy the server's Ed25519 public key from the Settings page and paste it here. The agent uses this to verify server identity before sending any data.\n\n### 3. Run\n\n```bash\n./rttys-agent              # foreground\n./rttys-agent -d           # daemon mode (logs to ~/.rttys/agent.log)\n./rttys-agent status       # check if running\n./rttys-agent stop         # stop daemon\n```\n\nThe agent reconnects automatically with exponential backoff (1s to 30s cap).\n\n## Security Model\n\n### Transport Security\n\nThe agent-to-server connection is protected by three layers:\n\n1. **Token authentication at HTTP layer** — the agent sends its token in the `X-Token` HTTP header during WebSocket upgrade. Invalid tokens are rejected before the WebSocket connection is established.\n2. **Ed25519 challenge-response** — after the WebSocket is established, the server signs the agent's token with its Ed25519 private key and sends it as a challenge. The agent verifies the signature using the pre-configured server public key. Data is only sent after verification passes.\n3. **Machine fingerprint binding** — the agent reports a SHA-256 hash of the machine's unique ID. The server records it on first connection and rejects mismatches on subsequent connections, preventing token reuse on different machines.\n\n### End-to-End Encryption\n\nAll terminal content (keystrokes and output) is end-to-end encrypted between the browser and the agent. The relay server cannot read or modify terminal data — it only forwards encrypted payloads.\n\n- **Key exchange**: ECDH P-256 ephemeral key pair per session, providing forward secrecy\n- **Symmetric encryption**: AES-256-GCM with counter-based nonces for replay protection\n- **Key derivation**: HKDF-SHA256 with directional keys (browser→agent and agent→browser use separate keys)\n- **MITM protection**: Each agent has an Ed25519 identity key. The browser stores it on first connection (Trust On First Use, like SSH). If the key changes, a warning dialog is shown.\n- **Control message integrity**: `pty.resize` and `pty.close` messages are authenticated with HMAC-SHA256\n\nVerify an agent's fingerprint by running `rttys-agent status` on the agent machine and comparing with what the browser shows.\n\n## Management API\n\nAll endpoints require authentication (session cookie). State-changing endpoints also require the `X-CSRF-Token` header.\n\n```bash\n# Setup (first-time only)\nGET    /api/setup/status\nPOST   /api/setup/init                    # {\"username\":\"x\",\"password\":\"y\"}\n\n# Auth\nPOST   /api/auth/login                    # {\"username\":\"x\",\"password\":\"y\"}\nGET    /api/auth/me\nPOST   /api/auth/logout\n\n# Users\nGET    /api/users\nPOST   /api/users                         # {\"username\":\"x\",\"password\":\"y\"}\nDELETE /api/users/:username\nPUT    /api/users/:username/password      # {\"password\":\"new\"}\n\n# User Preferences\nPUT    /api/preferences                   # {\"uiTheme\":\"dark\",\"terminalTheme\":\"ghostty\"}\n\n# Agent Tokens\nGET    /api/tokens\nPOST   /api/tokens                        # {\"label\":\"Home Mac\",\"notes\":\"...\"}\nPUT    /api/tokens/:id/enabled            # {\"enabled\":false}\nDELETE /api/tokens/:token\n\n# Agents\nGET    /api/agents\nDELETE /api/agents/:id\nDELETE /api/agents/:id/fingerprint        # Reset machine fingerprint\n\n# Server Key\nGET    /api/server-key                    # Get Ed25519 public key\n\n# Audit Log\nGET    /api/audit?limit=100\n```\n\n## Development\n\n### Prerequisites\n\n- Node.js 24+\n- Go 1.22+\n\n### Setup\n\n```bash\nnpm install\ncd agent \u0026\u0026 go mod download\n```\n\n### Run locally (3 terminals)\n\n```bash\n# Terminal 1: Relay\ncd packages/relay \u0026\u0026 npm run dev\n\n# Terminal 2: Web UI (Vite dev server, proxies to relay)\ncd packages/web \u0026\u0026 npm run dev\n\n# Terminal 3: Agent\ncd agent \u0026\u0026 go run . -relay ws://localhost:8080/ws/agent\n```\n\nOpen `http://localhost:5173` and create your admin account on the setup page.\n\n### Build\n\n```bash\nmake all        # build agent + relay + web\nmake agent      # Go binary → bin/rttys-agent\nmake relay      # TypeScript → packages/relay/dist/\nmake web        # Vite build → packages/relay/public/\n```\n\nCross-compile the agent:\n\n```bash\ncd agent\nGOOS=linux  GOARCH=amd64 go build -o rttys-agent-linux-amd64 .\nGOOS=darwin GOARCH=arm64 go build -o rttys-agent-darwin-arm64 .\n```\n\n### Type check\n\n```bash\ncd packages/relay \u0026\u0026 npx tsc --noEmit\ncd packages/web \u0026\u0026 npx tsc --noEmit\ncd agent \u0026\u0026 go vet ./...\n```\n\n## Project Structure\n\n```\nremotettys/\n├── agent/              # Go — local agent binary\n├── packages/\n│   ├── relay/          # TypeScript — WebSocket relay + REST API\n│   └── web/            # React + Vite — browser terminal UI\n├── Dockerfile          # Multi-stage build for server\n├── docker-compose.yml  # Production deployment\n├── Makefile            # Build all components\n└── package.json        # npm workspaces\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinch-xu%2Fremotettys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinch-xu%2Fremotettys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinch-xu%2Fremotettys/lists"}