cashmere

cashmere

How to check if your gpg-agent is running for SSH

Preface

you may come across the situation, were you are not quite sure if your ssh-agent is using your gpg-agent or not. Here are two commands to check if evertyhing is correctly set up or not.

Example

  1. Check environment variables:
echo $SSH_AUTH_SOCK

If the output contains a path which includes gpg-agent, then ssh is using the gpg-agent.

  1. Check if the gpg-agent daemon is running:
gpg-agent --daemon
gpg-agent: a gpg-agent is already running - not starting a new one
  1. List all your your current public keys:
ssh-add -L
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrybiMq4TgWa9lcbxWQDhLRUov0ctBuCx0F/uDMZv4MOTuRMDGiKGWcPre02jshSKPDNaTwKCISdwwPpfmosacyBkqgDcp1Yv5VWiKmtbOY8GeAxEBB6r7xEFrxNnXWnxUJDdyQ1ZEhb+Ods8ZZu5pUTXcPZahsMUamt/sWFORUEednI1HzFDumGa/9iUt890+fRElQ6PKvqXvGp8XKBm8ZsOunMGG5oSNHpS55WmYQTGBW5fSU3Krd3/OlXtBmLGZ0P5CXN/nXhKLRSEvQ9vAiIeelMd/NLpU5nl6gFPZDNZFklD41H7YfMtRONFbX25yfLs7/N7Aa0LTSDMU18Tf (none)
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILOwBidfdZzcSEIPSRT0C8U9U55WSES1ugqAKE+nvgQ9 (none)

References