Read host keys from environment variables

Darren Tucker dtucker at dtucker.net
Tue Aug 11 20:16:27 AEST 2026


On Tue, 11 Aug 2026 at 20:09, Philipp Marek <philipp at marek.priv.at> wrote:
[...]
> One point I see here is that in case someone breaks into the container,
> there's now a nicely defined API to fetch the host keys from,

No, the agent does not provide access to the raw keys.  It will sign
challenges on your behalf, but it won't cough up the keys themselves.

You *could* probably pick the keys out of memory with a debugger
(they're encrypted to mitigate rowhammer-style recovery attacks but a
root-equivalent user could defeat that pretty easily).  That said, if
you are in a position to do that to ssh-agent, you could just as
easily do that to sshd itself.

-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list