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 →
- Disable the global setting:
ForwardAgent noby default in~/.ssh/config. - For hops to a bastion, use
ProxyJumpinstead:ssh -J bastion app01. - For Git on servers, use deploy keys or short-lived tokens, not personal keys.
- 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.
More on Secrets, Signing and Security
A developer pushed an AWS access key to a public repo 10 minutes ago. What is your first move?BeginnerAfter rotating the leaked key, you must purge it from repository history. How?AdvancedA push is rejected: "GH013: Repository rule violations found ... Push cannot contain secrets". What do you do?IntermediateSecret scanning alerts have piled up, and many look like false positives or old test credentials.IntermediateYou must set up signed commits on your laptop. Which method do you pick?BeginnerYour GPG signing key expires next week. What is the correct way to handle it?Intermediate