Interview Prep/Git & GitHub/Secrets, Signing and Security

A teammate enables SSH agent forwarding to every host for convenience.

IntermediateScenarioSecrets, Signing and Security
Answer

Situation read → A forwarded agent lets root on the remote host use your keys while you are connected.

What I'd do →

  1. Disable the global setting: ForwardAgent no by default in ~/.ssh/config.
  2. For hops to a bastion, use ProxyJump instead: ssh -J bastion app01.
  3. For Git on servers, use deploy keys or short-lived tokens, not personal keys.
  4. Use hardware-backed keys that require touch for each use.

Why → ProxyJump gives the same convenience without exposing the agent.

Interview tip → Mention ssh-add -c (confirm on use) as a mitigation.

All Git & GitHub questions Roadmap: Git & GitHub

More on Secrets, Signing and Security