Last active
December 31, 2020 12:22
-
-
Save MartinBrugnara/271824d98e975d145b888043f3248bb9 to your computer and use it in GitHub Desktop.
Windows native & WSL2 SSH with gpg cards support (e.g. yubikey)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows & WSL1 & WSL 2 SSH with gpg cards support | |
>> Windows & WSL1 | |
Based upon: | |
- https://www.antirandom.com/2020/03/ssh-on-windows-with-private-key-on-yubikey/ | |
- https://github.com/benpye/wsl-ssh-pageant | |
Requirements: | |
- [win] gpg4win | |
* Edit %APPDATA%\gnupg\gpg-agent.conf to have | |
enable-putty-support | |
* Download WSL-SSH-Pageant (https://github.com/benpye/wsl-ssh-pageant/releases) | |
and install it somewhere e.g. C:\tools\wsl-ssh-pageant | |
Testing: | |
- Start bridge | |
C:\tools\wsl-ssh-pageant\wsl-ssh-pageant-amd64.exe -systray -verbose | |
-wsl C:\tools\wsl-ssh-pageant\wsl-ssh-agent.sock | |
--winssh win-ssh-pageant | |
- Kill if active and start gpg | |
gpgconf --kill gpg-agent | |
& "C:\Program Files (x86)\GnuPG\bin\gpg-connect-agent.exe" /bye | |
- Set windows env | |
$env:SSH_AUTH_SOCK="\\.\pipe\win-ssh-pageant" | |
- Test windows (should show keys in smarcard) | |
ssh-add -L | |
- Set wsl env | |
export SSH_AUTH_SOCK=/mnt/c/tools/wsl-ssh-pageant/wsl-ssh-agent.sock | |
-- see first resource for env automation and windows daemons. | |
>> WSL2 | |
https://github.com/BlackReloaded/wsl2-ssh-pageant |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment