fix(ssh): reuse connections only for GitHub and LAN hosts (#540)

Assisted-by: DeepSeek Harness (claude-opus-5-5)
This commit is contained in:
ryan4yin | 二花 authored and GitHub committed 2026-12-02 10:35:53 +08:00
1 parent fa6cded1da
commit b49a1dc3cf
2 files changed
+14 -16

No files matched your search

+5
View File
@@ -198,6 +198,11 @@ satisfy sudo. Agent forwarding is on for `192.168.*` and the `hostsAddr` aliases
([ssh.nix](../home/base/tui/ssh.nix)); without a forwarded agent, or with the key unplugged, sudo
asks for the password.
Other addresses, such as a tailnet IP, forward only with `ssh -A`. Without it, the server falls back
to its own agent, so sudo asks for the password and git fails with `agent refused operation`. The
aliases and `192.168.*` keep a `ControlMaster`, so forwarding there follows the first connection;
run `ssh -O exit <host>` if that master was opened without forwarding.
While a session is open, root on that server can also use the forwarded agent. Each signature still
needs a touch, so an unexpected blink is the signal to refuse it.