Site icon New Generation Enterprise Linux

Stop guessing if your SSH agent has the right keys

SSH & Remote Administration

Stop guessing if your SSH agent has the right keys

đź§© The Challenge

Dealing with a dozen different SSH keys across multiple clients is a nightmare, especially when you think you’re authenticated but the server keeps asking for a password. I’ve wasted way too much time logging out and in again just because I wasn’t sure which key was actually being offered to the remote box.

đź’ˇ The Fix

Use a quick command to query your running agent so you can see exactly which keys are loaded before you even try the connection. It saves you from that embarrassing moment when you realize you’re trying to authenticate with a three-year-old expired key.

ssh-add -l

⚙️ Why It Works

This lists the fingerprints of all identities currently held by the agent, allowing you to cross-reference them against what your server expects. If the list is empty or doesn’t contain the specific key you need, you’ll know exactly why your login attempt is failing.

🚀 Pro-Tip: Run ssh-add -L if you need to see the full public key strings instead of just the fingerprints.

Linux Tips & Tricks | © ngelinux.com | 9/27/2026

0 0 votes
Article Rating
Exit mobile version