You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[L] 2023/02/10 20:30:05 ssh <- [L] (5 B) <dummy for OpenSSH ext.>
63
+
[L] 2023/02/10 20:30:05 ssh -> [L] (5 B)
64
+
[L] 2023/02/10 20:30:05 [L] -> [W] (5 B)
65
+
[W] 2023/02/10 21:51:12 [L] -> [W] -> ssh-agent.exe (5 B)
66
+
[W] 2023/02/10 21:51:12 [L] <- [W] <- ssh-agent.exe (XXX B)
67
+
[L] 2023/02/10 20:30:05 [L] <- [W] (XXX B)
68
+
[L] 2023/02/10 20:30:05 ssh <- [L] (XXX B)
69
+
[L] 2023/02/10 20:30:05 ssh -> [L] (XXX B)
70
+
[L] 2023/02/10 20:30:05 [L] -> [W] (XXX B)
71
+
[W] 2023/02/10 21:51:12 [L] -> [W] -> ssh-agent.exe (XXX B)
72
+
[W] 2023/02/10 21:51:12 [L] <- [W] <- ssh-agent.exe (XXX B)
73
+
[L] 2023/02/10 20:30:05 [L] <- [W] (XXX B)
74
+
[L] 2023/02/10 20:30:05 ssh <- [L] (XXX B)
75
+
[L] 2023/02/10 20:30:05 ssh: closed
76
+
```
77
+
78
+
## How wsl2-ssh-agent works
79
+
80
+
Linux ssh client connects to ssh-agent via a UNIX domain socket, while ssh-agent.exe service on Windows is listening on a named pipe. This command connects those two in the following mechanism.
* wsl2-ssh-agent listens on a UNIX domain socket (by default, $HOME/.ssh/wsl2-ssh-agent.sock).
94
+
* wsl2-ssh-agent invokes PowerShell.exe as a child process, which can communicate with ssh-agent.exe service via a named pipe.
95
+
* wsl2-ssh-agent and PowerShell.exe communicates via stdin/stdout thanks to WSL2 interop.
96
+
97
+
## Note
98
+
99
+
Usually, ssh and ssh-agent should be the same version. However, OpenSSH on Ubuntu 22.04 is 8.9, while Windows bundles OpenSSH 8.6 (on my machine, as of this writing).
100
+
101
+
[OpenSSH has extended the ssh-agent protocol since 8.9](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.agent). However, ssh-agent.exe does not understand the extended message and will not communicate properly. ([Japanese article](https://zenn.dev/qnighy/articles/8b992970b86653))
102
+
103
+
To address this issue, wsl2-ssh-agent does not pass the extended message to ssh-agent.exe. Instead, it swallows the message and reply a dummy SSH_AGENT_SUCCESS message to ssh client. Note that this may reduce the security strength. Please use this tool at your own risk.
0 commit comments