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
Copy file name to clipboardExpand all lines: README.md
+25-12Lines changed: 25 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,8 @@ Starting with v1.5.1 releases are packed with zip and signed with [minisign](htt
52
52
## Usage
53
53
54
54
1. Ensure that on Windows side `ssh-agent.exe` service (OpenSSH Authentication Agent) is started and has your keys. (After adding keys to Windows `ssh-agent.exe` you may remove them from your wsl home .ssh directory - just do not forget to adjust `IdentitiesOnly` directive in your ssh config accordingly. Keys are securely persisted in Windows registry, available for your account only). You may also want to switch its startup mode to "automatic". Using powershell with elevated privileges (admin mode):
55
-
```
55
+
56
+
```powershell
56
57
Start-Service ssh-agent
57
58
Set-Service -StartupType Automatic ssh-agent
58
59
```
@@ -62,12 +63,12 @@ Starting with v1.5.1 releases are packed with zip and signed with [minisign](htt
62
63
* Using `-socket` option specify "well known" path on Windows side and then properly specify the same path in every WSL session:
@@ -85,12 +86,14 @@ Starting with v1.5.1 releases are packed with zip and signed with [minisign](htt
85
86
```
86
87
87
88
To avoid this and still be able to use `-setenv` and automatically generated socket path use `-envname` to specify variable name to set. Later on WSL side you could use:
88
-
```
89
+
90
+
```bash
89
91
export SSH_AUTH_SOCK=${<<YOUR-NAME-HERE>>}
90
92
```
91
93
92
94
When `wsl-ssh-agent-gui.exe` is running you could see what it is connected to by clicking on its icon in notification tray area and selecting `About`. At the bottom of the message you would see something like:
@@ -105,7 +108,7 @@ For security reasons unless `-nolock` argument is specified program will refuse
105
108
106
109
Run `wsl-ssh-agent-gui.exe -help`
107
110
108
-
```
111
+
```terminal
109
112
---------------------------
110
113
wsl-ssh-agent-gui
111
114
---------------------------
@@ -144,15 +147,16 @@ Options:
144
147
145
148
At the moment AF_UNIX interop does not seems to be working with WSL2 VMs. Hopefully this will be sorted out eventually. Meantime there is an easy workaround (proposed by multiple people) which does not use wsl-ssh-agent.exe at all and relies on combination of linux socat tool from your distribution and [npiperelay.exe](https://github.com/jstarks/npiperelay). Put npiperelay.exe somewhere on devfs for interop to work its magic (I have `winhome ⇒ /mnt/c/Users/rupor` in my $HOME directory for that) and add following lines in your .bashrc/.zshrc:
You *really* have to be on WSL 2 in order for this to work - if you see errors like `Cannot open netlink socket: Protocol not supported` - you probably are under WSL 1 and should not use this workaround. Run `wsl.exe -l -all -v` to check what is going on. When on WSL 2 make sure that socat is installed and npiperelay.exe is on windows partition and path is right. For convinience I will be packing pre-build npiperelay.exe with wsl-ssh-agent.
158
+
159
+
You *really* have to be on WSL 2 in order for this to work - if you see errors like `Cannot open netlink socket: Protocol not supported` - you probably are under WSL 1 and should not use this workaround. Run `wsl.exe -l --all -v` to check what is going on. When on WSL 2 make sure that socat is installed and npiperelay.exe is on windows partition and path is right. For convinience I will be packing pre-build npiperelay.exe with wsl-ssh-agent. Please also ensure that `socat` is installed: `sudo apt install socat`.
156
160
157
161
## Example
158
162
@@ -161,26 +165,35 @@ Putting it all together nicely - `remote` here refers to your wsl shell or some
161
165
For my WSL installations I always create `~/winhome` and link it to my Windows home directory (where I have `.wsl` directory with various interoperability tools from Windows side). I am assuming that [gclpr](https://github.com/rupor-github/gclpr) is in your path on `remote` and you installed it's Windows counterpart somewhere in `drvfs` location (~/winhome/.wsl is a good place).
162
166
163
167
I auto-start `wsl-ssh-agent-gui.exe` on logon on my Windows box using following command line:
0 commit comments