Stop SSH from asking for your password when you have an agent running

SSH & Remote Administration

Stop SSH from asking for your password when you have an agent running

🧩 The Challenge

Dealing with a dozen jump hosts and getting prompted for your password every time you reconnect is a total productivity killer. You know your local agent is loaded, but SSH just ignores it and wastes your time.

💡 The Fix

Forcing SSH to try your local keys before anything else saves you from having to type passphrases for every single hop. You just need to tweak your client config to prioritize identities.

echo "IdentitiesOnly yes" >> ~/.ssh/config

⚙️ Why It Works

Setting this option tells your SSH client to ignore every key in your local agent except for the ones you’ve explicitly defined in your config or command line. It stops the client from spamming servers with every key you own, which usually triggers those annoying “too many authentication failures” errors.

🚀 Pro-Tip: Use IdentityFile to pin specific keys to specific hosts in your config so you don’t even have to think about which key to use.

Linux Tips & Tricks | © ngelinux.com | 8/5/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted