Last active
August 18, 2025 11:41
-
-
Save TallonRain/2e6b876a0caacb705a68c6c7076bbb3e to your computer and use it in GitHub Desktop.
Set up Fish Shell to use gpg-agent as the SSH agent for Yubikeys and other smart cards
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
# Add these contents to ~/.config/fish/config.fish | |
# If using Brew, config.fish is located in /usr/local/Cellar/fish/[version]/etc/fish/ | |
# Generally recommend using the installer from https://fishshell.com instead of brew | |
# to avoid version updates overwriting the config file | |
# Start or re-use a gpg-agent. | |
gpgconf --launch gpg-agent | |
# Ensure that GPG Agent is used as the SSH agent | |
set -e SSH_AUTH_SOCK | |
set -U -x SSH_AUTH_SOCK ~/.gnupg/S.gpg-agent.ssh | |
# Credit and more info: https://rnorth.org/easier-gpg-agent-with-gpg/ |
Updated the link, thanks
The gpg agent socket wasn't in $HOME/.gnupg
on my system (Fedora 42).
I used the output of gpgconf --list-dirs agent-ssh-socket
as value for SSH_AUTH_SOCK
.
set -gx SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current link: https://rnorth.org/easier-gpg-agent-with-gpg/