Last active
July 2, 2026 13:26
-
-
Save Reclyptor/b6b4b698d0f1e7ff9297012d24ab0452 to your computer and use it in GitHub Desktop.
Windows GPG Agent Configuration
This file contains hidden or 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
| # WSL2 SSH Pageant | |
| export SSH_AUTH_SOCK="$HOME/.ssh/agent.sock" | |
| if ! ss -a | grep -q "$SSH_AUTH_SOCK"; then | |
| rm -f "$SSH_AUTH_SOCK" | |
| wsl2_ssh_pageant_bin="$HOME/.ssh/wsl2-ssh-pageant" | |
| if test -x "$wsl2_ssh_pageant_bin"; then | |
| (setsid nohup socat UNIX-LISTEN:"$SSH_AUTH_SOCK,fork" EXEC:"$wsl2_ssh_pageant_bin" >/dev/null 2>&1 &) | |
| else | |
| echo >&2 "WARNING: $wsl2_ssh_pageant_bin is not executable." | |
| fi | |
| unset wsl2_ssh_pageant_bin | |
| fi | |
| ## GPG | |
| export GPG_AGENT_SOCK="$HOME/.gnupg/S.gpg-agent" | |
| if ! ss -a | grep -q "$GPG_AGENT_SOCK"; then | |
| rm -rf "$GPG_AGENT_SOCK" | |
| wsl2_ssh_pageant_bin="$HOME/.ssh/wsl2-ssh-pageant" | |
| if test -x "$wsl2_ssh_pageant_bin"; then | |
| (setsid nohup socat UNIX-LISTEN:"$GPG_AGENT_SOCK,fork" EXEC:"$wsl2_ssh_pageant_bin --gpg S.gpg-agent" >/dev/null 2>&1 &) | |
| else | |
| echo >&2 "WARNING: $wsl2_ssh_pageant_bin is not executable." | |
| fi | |
| unset wsl2_ssh_pageant_bin | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment