Last active
June 14, 2020 10:53
-
-
Save doitian/078e6872a017754c28dd5ce0aa10375b to your computer and use it in GitHub Desktop.
Share ssh and gpg keys with WSL
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
ln -snf "$(which plink.exe)" "$HOME/bin/ssh" | |
ln -snf "$(which pscp.exe)" "$HOME/bin/scp" | |
# Or use Win32 OpenSSH. Since it does not support gpg-agent, I use putty instead | |
# ln -snf "$(which ssh.exe)" "$HOME/bin/ssh" | |
# ln -snf "$(which scp.exe)" "$HOME/bin/scp" | |
ln -snf "$(which gpg.exe)" "$HOME/bin/gpg" | |
ln -snf "$(which gopass.exe)" "$HOME/bin/gopass" | |
# Prepend $HOME/bin to PATH somewhere in the shell rc file. | |
# export PATH="$HOME/bin:$PATH" |
If git throws error like "unknown option -o", configure core.sshCommand
to disable git protocol 2
git config --global core.sshCommand "$(which plink.exe)"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since WSL2 can use Windows executable directly, the most straightforward way is just using the Windows counterparts.