> [...] only takes a moment [...]
Not every org's policy allows adding unaudited ad-hoc SSH keys.
> [...] much, much safer [...]
Definitely not always, if the hosts you store these keys on are not as hardened as you local machine (or a hardware key connected to it).
Then audit them and get them in the process. Agent forwarding is too big of a risk.
> Definitely not always, if the hosts you store these keys on are not as hardened as you local machine (or a hardware key connected to it).
Once you use agent forwarding, the keys are no longer protected on your local machine. (Ironically, this RCE is precisely because of the requirement to whitelist hardware keys!)
Between local and jump host, there will be two layers of encryption. The jump host decrypts the outer layer, and the two ends the inner layer.
c) use proxyjump (-J) to access bar (https://www.man7.org/linux/man-pages/man1/ssh.1.html), and/or
d) generate a new private key on foo and use that to access github.
You might think that's a crazy waste of time compared to forwarding, but it's actually much, much safer and actually only takes a moment:
and then just paste that in Github.See also https://userify.com/docs/jumpbox for more jumpbox docs.