Gpg — Dongle Setup
enable-ssh-support Restart and add to shell profile ( ~/.bashrc or ~/.zshrc ):
gpg --card-edit Within the interactive shell:
brew install gnupg ykman pinentry-mac :
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) Test SSH:
gpg --card-status Expected output shows: gpg dongle setup
gpg --export-ssh-key YOUR_KEYID > ~/.ssh/id_rsa_gpg.pub Add to ~/.ssh/config :
# PC/SC driver pcsc-driver /usr/lib/libpcsclite.so # Disable CCID (for YubiKey) disable-ccid # Enable card removal notification card-timeout 5 Edit ~/.gnupg/gpg-agent.conf : enable-ssh-support Restart and add to shell profile ( ~/
Host * IdentityFile ~/.ssh/id_rsa_gpg.pub IdentitiesOnly yes Enable SSH agent forwarding in ~/.gnupg/gpg-agent.conf :
sudo systemctl restart pcscd Edit ~/.gnupg/scdaemon.conf : keytocard Select destination slot (1=Sign
gpg --edit-key YOUR_KEYID gpg> keytocard Select destination slot (1=Sign, 2=Encrypt, 3=Authenticate). Repeat for each subkey. Extract the authentication key for SSH:
gpgconf --kill gpg-agent Set admin PIN, user PIN, and reset code (optional):