SSH Permission denied (publickey)

Problem: Log-in to remote machine is not possible, even when the right key was added using ssh-add.

Solution Reduce the number of key files lying in .ssh to a maximum of 6 to workaround this issue.

Background Check .ssh directory and the key files inside. Your ssh-agent will try all key files lying here to log-in. If it is failing for 6 key files (default ssh server configuration), the server will deny connection, even you have the correct key file added.

The default number may vary, depending on OpenSSH version and the system.