Files
archived-orca/src/cli/specs/cloud-ssh.ts
T
Neil 984f29fc37 feat(cloud): SSH into Orca Cloud workspaces (orca ssh, ssh-proxy, VS Code/Cursor Remote-SSH) (#55)
* feat(cloud): SSH into Orca Cloud workspaces (orca ssh, ssh-proxy, VS Code/Cursor Remote-SSH)

- VM: unprivileged key-only sshd on 127.0.0.1:2222 (orca-sshd), host key and Orca-managed
  authorized_keys on the persistent disk; orca-ssh-keys entry point; provision extracts only the
  server binaries (dnf or apt, +1.5-2 MB) and unlocks the sandbox user for key logins.
- Control plane: POST/DELETE /v1/sandboxes/:id/ssh-keys runs the fixed entry point and answers
  the pinned host key; editor Remote-SSH server hosts on the egress allowlist.
- Desktop: per-workspace ed25519 keys in userData (0600), Orca-owned ssh_config + pinned
  known_hosts, ~/.ssh/config Include only after consent; wake -> key -> runtime port forward
  (openRuntimePortForward reason 'ssh'); revoke (deferred while asleep); SSH traffic keeps the
  workspace awake.
- CLI: orca ssh-proxy <workspace> (ProxyCommand) and orca ssh <workspace>.
- UI: Open in -> VS Code / Cursor over Remote SSH, SSH submenu (Copy SSH Command, Revoke),
  include consent dialog, progress/error toasts.

* fix(cloud-ssh): review fixes — no agent forwarding, reinstall per VM boot, wake to revoke

- ForwardAgent/ForwardX11 no in Orca's host blocks; AllowAgentForwarding no in the VM's sshd.
- Reinstall the key (idempotent; restarts sshd, re-pins the host key) once per VM boot, so a
  wiped disk, rollover or dead sshd heals on the next connection.
- Revoke wakes the VM to remove its copy; only an unreachable VM falls back to the queue.
- orca-ssh-keys rejects multi-line keys; sshd log truncated per start; audit log entries for
  ssh key add/remove; state parsed per entry; % escaped in ssh_config paths; ProxyCommand pinned
  to this app's profile; ssh-proxy flushes stdout before exit; --print shell-quotes; editors
  open via --folder-uri with a checked path; "Remove from ~/.ssh/config" + one-time backup.
2026-11-09 06:37:23 -08:00

35 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { CommandSpec } from '../args'
import { LOCAL_COMMAND_FLAGS } from '../args'
export const CLOUD_SSH_COMMAND_SPECS: CommandSpec[] = [
{
path: ['ssh'],
summary: 'Open an SSH session in an Orca Cloud workspace, waking it if it sleeps',
usage: 'orca ssh <workspace> [--command <command>] [--print]',
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'workspace', 'command', 'print'],
positionalArgs: ['workspace'],
notes: [
'<workspace> is the workspace name, its SSH host name (orca-…), or its id.',
'The first use creates a key for this computer and installs it in the workspace. Keys and the SSH config are Orca’s own files; ~/.ssh is not touched.',
'Runs ssh with Orca’s config file (-F), so the session tunnels through `orca ssh-proxy` over Orca’s connection to the workspace. --print shows that ssh command instead of running it.',
'Needs the Orca desktop app; it starts when it is not running.'
],
examples: [
'orca ssh "Fix login bug"',
'orca ssh orca-fix-login-bug-1a2b --command "git status"'
]
},
{
path: ['ssh-proxy'],
summary: 'Carry one SSH connection to an Orca Cloud workspace (ssh ProxyCommand)',
usage: 'orca ssh-proxy <workspace>',
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'workspace'],
positionalArgs: ['workspace'],
notes: [
'Orca’s SSH config sets this as ProxyCommand; editors’ Remote-SSH run it too. It wakes the workspace, then pipes stdin and stdout to the workspace’s sshd.',
'Writes only the SSH stream to stdout; errors go to stderr.'
],
examples: ['orca ssh-proxy orca-fix-login-bug-1a2b']
}
]