Skip to content

Instantly share code, notes, and snippets.

@sendya
Forked from TallonRain/config.fish
Created December 28, 2022 11:17
Show Gist options
  • Save sendya/d3fe55cfb7f2b1489c912d35586d1b55 to your computer and use it in GitHub Desktop.
Save sendya/d3fe55cfb7f2b1489c912d35586d1b55 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
# 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-ssh-agent-with-gpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment