How to use ssh -i with a key from ssh-agent rather than from a file?

raf ssh at raf.org
Wed Sep 30 14:38:23 AEST 2020


Hi,

I have a VM with a git repository whose origin is on
github. I have several keys known to github, so I needed
to set git's core.sshcommand config parameter in the
repository to something like this:

  ssh -i ~/.ssh/id_ed25519_github2

But it meant that I needed to copy that key to the VM.
The same key is available via my forwarded ssh-agent
connection. Is it possible to tell ssh to use that
instead of the key in a file? The documentation for the
-i option only mentions files.

cheers,
raf



More information about the openssh-unix-dev mailing list