# 1. Install requirements (if not already present)sudo apt install gnupg2 scdaemon pcscd# 2. Start the smartcard daemonsudo systemctl start pcscd# 3. Import your public key gpg --card-edit> fetch# 4. Verify the card is detectedgpg --card-status# 5. Set up SSH agent (same as above)export GPG_TTY=$(tty)export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)gpgconf --kill gpg-agentgpgconf --launch gpg-agent# 6. Verify SSH sees the keyssh-add -L# Should show your key# 7. SSH to your serverssh user@your-server
Git Commit Signing with YubiKey
# Set your signing keygit config --global user.signingkey YOUR_KEY_ID# Use GPG for signinggit config --global gpg.program gpg# Sign all commits by defaultgit config --global commit.gpgsign true# Sign all tags by defaultgit config --global tag.gpgsign true