Interview Prep/Jenkins/Agents, executors & the queue

SSH agent launch fails: `[SSH] Opening SSH connection to 10.0.4.12:22. ... Server rejected the 1 private key(s) for jenkins (credentialId:agent-ssh/method:publickey)`

IntermediateTroubleshootingAgents, executors & the queue
Answer

Likely causes → Public key not in the agent user's authorized_keys, wrong user, bad file permissions, or key type disabled by the server.

Diagnose → On the agent: ls -la ~jenkins/.ssh, journalctl -u ssh for the rejection reason; test from the controller with the same key.

Fix → Add the key, fix permissions (700 ~/.ssh, 600 authorized_keys), use an ed25519 or RSA key the server accepts.

Prevent → Provision agents with configuration management and keep the key in JCasC credentials.

All Jenkins questions Roadmap: Jenkins

More on Agents, executors & the queue