mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
SSH agent forwarding per VM: off by default, on (your agent, --ssh-agent for a new VM) or devvm (devvm's own agent, holding only keys added to it). devvm ssh-agent [on|devvm|off] shows or changes it from the VM's next start; devvm ssh-agent add KEY_FILE [--confirm] [--lifetime D] loads a key into devvm's agent and records it with its pinned fingerprint (agent-keys); devvm ssh-agent keys lists them. Keys are loaded again on launch (after a reboot or their lifetime), only while the file holds the pinned key and isn't in a folder a VM mounts. - internal/sshagent: Mode/Key, Agent (Ensure, Add, Keys), its messages. - vm: --ssh-agent on create, applyAgent and checkAgent on relaunch, ssh_agent_flag_ignored, devvm's agent socket at start, SSH_AUTH_SOCK per mode for devvm's own connections, SetSSHAgent/SSHAgent. - sshconfig: ForwardAgent from the VM's state; devvm mode forwards and names devvm's socket (IdentityAgent). - ssh_remote_hint names devvm ssh-agent on; skipped with --ssh-agent. - Tests: sshagent table tests (the five bats cases) plus one with real OpenSSH tools and a throwaway agent; vm tests; ssh_agent.txtar with ssh-agent/ssh-add/ssh-keygen stubs; e2e project section "SSH agents". The test task and e2e unset SSH_AUTH_SOCK. - Docs: ssh.md agent forwarding and devvm's own agent, commands, security, contributing; CLI reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
10 lines
382 B
Bash
Executable File
10 lines
382 B
Bash
Executable File
#!/bin/bash
|
|
# Stand-in for ssh-agent in tests: logs every call to $STUB_LOG, and with -a
|
|
# SOCKET "runs" an agent there: $STUB_DIR/agent-up holds its socket, and
|
|
# $STUB_DIR/agent-held the keys it holds (see the ssh-add stub).
|
|
set -euo pipefail
|
|
echo "ssh-agent $*" >> "$STUB_LOG"
|
|
[[ ${1:-} == -a && -n ${2:-} ]] || exit 1
|
|
echo "$2" > "$STUB_DIR/agent-up"
|
|
: > "$STUB_DIR/agent-held"
|