1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 22:42:48 +03:00
wezterm/wezterm-ssh/src
Wez Furlong 6b93ee19e7
mux: record client ssh_auth_sock information
This commit expands the set of data that we track for each client to
include the SSH_AUTH_SOCK. This defaults to the value of that env var on
the machine where the ClientId is constructed, which may be remote from
the mux server.

For the proxy scenario, a remote SSH_AUTH_SOCK path is not addressable,
and what we really want is the local SSH_AUTH_SOCK path from that SSH
session, so we introduce awareness of whether the current session is a
proxy session. Proxy sessions register the mux-local-proxy-id during the
setup of the proxy, but we don't apply the identity to the mux. Instead,
we wait for the remote client to send their identity and that is
annotate to show that it has been routed via a proxy and, crucially, has
the SSH_AUTH_SOCK replaced with the mux-local-proxy-id SSH_AUTH_SOCK.

```
; wezterm cli list-clients
USER HOST                          PID CONNECTED     IDLE         WORKSPACE FOCUS SSH_AUTH_SOCK
wez  foo                        336500 86.944834352s 944.834352ms default       3 /home/wez/.1password/agent.sock
wez  foo (via proxy pid 337457) 337314 1.944834352s  944.834352ms               4 /tmp/ssh-XXXXTfGSp7/agent.337456
```

For the SSH_AUTH_SOCK to be populated, ssh agent forwarding also needs
to be enabled for SSH exec() calls; previously it was enabled only for
pty channels.

Since this commit changes the ABI of the mux protocol, the codec
version has been bumped.
2024-05-09 07:45:19 -07:00
..
sftp Fix sftp::FilePermissions::is_readonly to properly report readonly status 2023-05-27 09:46:36 -07:00
auth.rs Support gating libssh-rs and ssh2 behind features of same name 2022-01-09 19:36:56 -08:00
channelwrap.rs Wire up agent forward for libssh backend (#5345) 2024-05-08 08:09:07 -07:00
config.rs Fix SSH config %h using Host (#5163) 2024-05-05 13:43:52 -07:00
dirwrap.rs Support gating libssh-rs and ssh2 behind features of same name 2022-01-09 19:36:56 -08:00
filewrap.rs Support gating libssh-rs and ssh2 behind features of same name 2022-01-09 19:36:56 -08:00
host.rs ssh: improve host key verification error messaging 2023-07-06 10:42:58 -07:00
lib.rs Re-export portable_pty::{PtySize, MasterPty, ChildKiller} as it is available in public API (#1603) 2022-01-30 18:27:29 -07:00
pty.rs Wire up agent forward for libssh backend (#5345) 2024-05-08 08:09:07 -07:00
session.rs ssh: improve host key verification error messaging 2023-07-06 10:42:58 -07:00
sessioninner.rs mux: record client ssh_auth_sock information 2024-05-09 07:45:19 -07:00
sessionwrap.rs Wire up agent forward for libssh backend (#5345) 2024-05-08 08:09:07 -07:00
sftpwrap.rs Wire up agent forward for libssh backend (#5345) 2024-05-08 08:09:07 -07:00