Documentation
¶
Overview ¶
Package askpass delivers a passphrase to ssh-keygen without it ever appearing on a command line.
ssh-keygen's -N flag is unusable for a real passphrase: argv is world-readable through ps and /proc/<pid>/cmdline, so every local user can read it for as long as the process runs. Piping to stdin does not work either, because ssh-keygen asks via readpassphrase(3), which opens /dev/tty in preference to stdin whenever a terminal exists.
What does work is the askpass protocol: ssh-keygen executes the program named by SSH_ASKPASS and reads the passphrase from its standard output. sshmgr names itself, so no separate helper binary has to be installed or trusted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Environ ¶
Environ returns the full child environment for an ssh-keygen invocation that should ask self for the passphrase.
SSH_ASKPASS_REQUIRE=force (OpenSSH 8.4 and later) is what makes this work with a terminal attached; without it ssh-keygen reads /dev/tty directly and ignores the helper. Older ssh-keygen ignores the variable and falls back to prompting on the terminal, or to reading stdin when there is no terminal - both of which keep the passphrase off the command line, so no version check is needed.
Types ¶
This section is empty.