keyfunc ssh to and keyfunc ssh install start the system ssh and sftp with the tool's whole environment. When the mnemonic came from KEYFUNC_MNEMONIC, the child process holds the mnemonic in its environment for as long as it runs (readable in /proc/<pid>/environ by the same user, and forwardable to the host by a SendEnv line in the user's ssh config). ssh to exists so the private key never leaves the tool; the mnemonic must not leave it either.
Implementation
In internal/cli/ssh/to.go (connect) and internal/cli/ssh/install.go (session), set the child's Env to the tool's environment with KEYFUNC_MNEMONIC and KEYFUNC_MNEMONIC_COMMAND removed. Use the constants mnemonic.Variable and mnemonic.CommandVariable; one small shared helper in the ssh cli package, no new package.
The mnemonic command itself (internal/mnemonic) keeps the full environment.
README, "Giving it the mnemonic": one sentence saying the two variables are not passed on to ssh or sftp.
Definition of done
A test with a fake ssh and a fake sftp on PATH that record their environment shows neither variable reaches them, for both ssh to and ssh install, while another variable set in the test does.
README sentence added and true of the code.
make check green. Branch cut from next, PR base next.
Model: fable-5-1
`keyfunc ssh to` and `keyfunc ssh install` start the system `ssh` and `sftp` with the tool's whole environment. When the mnemonic came from `KEYFUNC_MNEMONIC`, the child process holds the mnemonic in its environment for as long as it runs (readable in `/proc/<pid>/environ` by the same user, and forwardable to the host by a `SendEnv` line in the user's ssh config). `ssh to` exists so the private key never leaves the tool; the mnemonic must not leave it either.
## Implementation
- In `internal/cli/ssh/to.go` (`connect`) and `internal/cli/ssh/install.go` (`session`), set the child's `Env` to the tool's environment with `KEYFUNC_MNEMONIC` and `KEYFUNC_MNEMONIC_COMMAND` removed. Use the constants `mnemonic.Variable` and `mnemonic.CommandVariable`; one small shared helper in the `ssh` cli package, no new package.
- The mnemonic command itself (`internal/mnemonic`) keeps the full environment.
- README, "Giving it the mnemonic": one sentence saying the two variables are not passed on to `ssh` or `sftp`.
## Definition of done
- A test with a fake `ssh` and a fake `sftp` on `PATH` that record their environment shows neither variable reaches them, for both `ssh to` and `ssh install`, while another variable set in the test does.
- README sentence added and true of the code.
- `make check` green. Branch cut from `next`, PR base `next`.
Model: fable-5-1
clawbot
self-assigned this 2026-09-21 09:17:56 +02:00
ssh to (connect) and ssh install (session) now start the system ssh
and sftp with the tool's environment stripped of KEYFUNC_MNEMONIC and KEYFUNC_MNEMONIC_COMMAND, through one shared helper in the ssh cli
package. The mnemonic command still runs with the full environment. The
CLI stand-in ssh and sftp now record their environment, and two tests
drive ssh install and ssh to and show neither variable reaches them
while another one set alongside them does. README gained one sentence.
Model: opus-4-8
PR: https://git.eeqj.de/sneak/keyfunc/pulls/29
`ssh to` (connect) and `ssh install` (session) now start the system `ssh`
and `sftp` with the tool's environment stripped of `KEYFUNC_MNEMONIC` and
`KEYFUNC_MNEMONIC_COMMAND`, through one shared helper in the ssh cli
package. The mnemonic command still runs with the full environment. The
CLI stand-in `ssh` and `sftp` now record their environment, and two tests
drive `ssh install` and `ssh to` and show neither variable reaches them
while another one set alongside them does. README gained one sentence.
Model: opus-4-8
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
keyfunc ssh toandkeyfunc ssh installstart the systemsshandsftpwith the tool's whole environment. When the mnemonic came fromKEYFUNC_MNEMONIC, the child process holds the mnemonic in its environment for as long as it runs (readable in/proc/<pid>/environby the same user, and forwardable to the host by aSendEnvline in the user's ssh config).ssh toexists so the private key never leaves the tool; the mnemonic must not leave it either.Implementation
internal/cli/ssh/to.go(connect) andinternal/cli/ssh/install.go(session), set the child'sEnvto the tool's environment withKEYFUNC_MNEMONICandKEYFUNC_MNEMONIC_COMMANDremoved. Use the constantsmnemonic.Variableandmnemonic.CommandVariable; one small shared helper in thesshcli package, no new package.internal/mnemonic) keeps the full environment.sshorsftp.Definition of done
sshand a fakesftponPATHthat record their environment shows neither variable reaches them, for bothssh toandssh install, while another variable set in the test does.make checkgreen. Branch cut fromnext, PR basenext.Model: fable-5-1
PR: #29
ssh to(connect) andssh install(session) now start the systemsshand
sftpwith the tool's environment stripped ofKEYFUNC_MNEMONICandKEYFUNC_MNEMONIC_COMMAND, through one shared helper in the ssh clipackage. The mnemonic command still runs with the full environment. The
CLI stand-in
sshandsftpnow record their environment, and two testsdrive
ssh installandssh toand show neither variable reaches themwhile another one set alongside them does. README gained one sentence.
Model: opus-4-8