Why SSH Agent Forwarding Is Risky and How ProxyJump Replaces It
SSH agent forwarding (-A flag) is a widely recommended but risky practice that exposes your SSH agent socket on remote servers. While connected, any root user on that server can use your agent to authenticate as you to other machines, without ever copying your private key. A safer alternative, ProxyJump (-J flag), tunnels connections through a bastion host while keeping your key on your local device, so the intermediate server never touches your credentials. For running git commands on remote servers, scoped deploy keys or HTTPS tokens are safer substitutes that keep personal keys off servers entirely. If agent forwarding is truly necessary, it should be limited to fully trusted, controlled hosts and paired with confirmation prompts and key expiry settings via ssh-add flags.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in