Repository navigation
Let agents work on SSH servers with a password or key (GODM-36) - #36
Merged
Merged
Conversation
SSH servers are saved with their password, private key and passphrase sealed in the vault and assigned to agents (every run) or chats (the SSH chip). Runs get an ssh MCP server: shell with sudo answered by Godmode, SFTP file tools with a shell fallback, and uploads/downloads within the run's folders. Host keys are pinned on the first connection. The SSH servers page adds, tests and assigns servers and runs quick commands.
# Conflicts: # apps/desktop/src/pages/chat/chat-home.tsx # packages/core/src/db/migrations.ts # packages/core/src/runner/mcpConfig.ts # packages/core/src/runner/prompt.ts # packages/core/src/runner/runner.ts # packages/core/src/server/routes/chat.ts # packages/core/src/services/conversations.ts # packages/core/test/scheduler.test.ts # packages/shared/src/api.ts # packages/shared/src/events.ts # packages/shared/src/models.ts # pnpm-lock.yaml
… key lines (GODM-36) - sudo gets the saved password only when its prompt (a random marker) appears, so the line can't become input for the command; a second prompt reports a rejected password - downloads refuse dangling links and .git/.claude folders and are renamed into place from a new file - results mask the password, passphrase and every line of the saved key - a connection made before a server moved no longer pins its host key; the OS is probed again after a move - ids of deleted servers are dropped instead of blocking changes; chats hear about a deleted server - SFTP calls honour run cancellation; honest wording for timed-out commands - screenshots in the README
# Conflicts: # apps/desktop/src/pages/chat/chat-home.tsx # packages/core/src/db/migrations.ts # packages/core/src/server/app.ts
# Conflicts: # README.md # apps/desktop/src/components/agents/agent-form.tsx # packages/core/src/db/migrations.ts # packages/core/src/runner/prompt.ts # packages/core/src/runner/runner.ts # packages/core/src/vault/vault.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Agents can now work on remote machines over SSH (GODM-36).
~/.sshor generate a new Ed25519 key (with a copy-readyauthorized_keyscommand). Test connection signs in once and pins the server's host key. After that, a server that shows a different key is refused. Each card shows the status, OS, pinned key and who uses the server, and has a quick Run command box.sshMCP tools for runs that have servers:list_serversshell: runs in the account's own shell. Withsudo: true, Godmode answers sudo's prompt, and the password only goes out when sudo's own randomized prompt appears.read_file/write_file/edit_file: over SFTP, falling back to the shell when a server has no SFTP.upload/download: only within the run's folders. Downloads never follow dangling links and never write into.gitor.claudefolders.ssh2, which is pure JavaScript, so it works in the compiled sidecar on every target. Its optional native helpers are never built. There is one pooled connection per server, keepalives are on, and a connection closes after 3 idle minutes or when the server's settings change.docs/ARCHITECTURE.md(SSH servers) andSECURITY.md.The chat screenshot is a real Claude run against a local test SSH server. The agent read the config and the log, backed up the config and changed it, and didn't restart anything.
How was it tested?
pnpm typecheckpasses,pnpm --filter @godmode/desktop buildpasses, and the core suite passes: 761 tests, 0 fail.packages/core/test/ssh.test.ts(19 tests) runs against an in-process SSH server (test/fixtures/ssh-server.ts: ssh2's server side with password and key sign-in, realshcommands, SFTP and a fakesudo). It covers:~/.ssh).gitand.claude), masking of the password and the key's linessshd(key auth, exec, SFTP). The compiled sidecar builds and passes its smoke test.Checklist
pnpm typecheckandpnpm testpasscargo clippy/cargo testpass (ifapps/desktop/src-taurichanged) — not changedpackages/sharedandapps/desktop/src/lib/api.ts