3 ms·
Agent forwarding is powerful but dangerous. Prefer ProxyJump where applicable. With Agent forwarding any authorised machine you connect to (and thus anyone who
by tialaramex 7y ago
Agent forwarding is powerful but dangerous. Prefer ProxyJump where applicable.
With Agent forwarding any authorised machine you connect to (and thus anyone who controls that machine) gets to use your credentials for the duration, to my knowledge no general purpose clients give you feedback on this usage, so you won't know if this happened - if Agent forwarding is enabled it can be used even if you never use it. With ProxyJump the intermediate doesn't get any view of your credentials, not even whether those are the same credentials you used for that intermediate host, or different. It is only enabling you to connect to a host it can reach that you can't reach directly and nothing more.
- atmosx 7y agoIndeed, my first thought when I read “agent-forwarding” is “scary”.
- pritambaral 7y agoMy agent asks for confirmation on every use. No need to be scared. See my other comment for more details: https://news.ycombinator.com/item?id=22753590 https://news.ycombinator.com/item?id=22753590
- pritambaral 7y ago> ... to my knowledge no general purpose clients give you feedback on this usage, so you won't know if this happened I'm afraid you're mistaken here. ssh-add(1) and ssh-askpass(1) support confirmation per-use: https://man.openbsd.org/ssh-add.1#c https://man.openbsd.org/ssh-add.1#c The agent I personally use — gpg-agent — also respects this protocol and asks me to confirm each use: https://www.gnupg.org/documentation/manuals/gnupg/Agent-Configuration.html#index-sshcontrol https://www.gnupg.org/documentation/manuals/gnupg/Agent-Conf... Even if it did not, I can always configure gpg-agent to never cache the passphrase, thus making it ask me for the passphrase every time. This would also adequately serve as a means of confirmation, but thankfully this tedious option is not necessary, because of the above. > Prefer ProxyJump where applicable. I already do, but it's pretty orthogonal to agent-forwarding. The uses of agent-forwarding I mention in my original comment simply cannot be served by ProxyJump.
- tialaramex 7y agoToday I Learned. Seems like a key component (AddKeysToAgent Confirm) was in OpenSSH 7.2 in 2016, but I felt like I checked this wasn't an option more recently. Happy to be proven wrong, thank you.