Error Fix

How to Fix 'Permission denied' When Using a Key

A generic SSH key troubleshooting path when access fails but the server is reachable.

If SSH reaches the host but rejects key-based access, the issue is usually key selection, agent state, authorized_keys configuration, or permissions on the server side.

Best Fixes

Use verbose SSH output to confirm which key was offered and whether the intended key is loaded and configured.

Check server-side authorized_keys contents and the permissions of the `.ssh` directory and files.

Avoid This

Do not spam new keys into the server without understanding which client identity should be used.

Do not ignore file-permission problems on the server that cause SSH to reject valid-looking keys.

Save commands, add notes, and build a Cheatbook with the fixes you want to keep handy.