I just spent 20 minutes trying to figure out why my passwordless SSH wasn’t working. I’ve done it dozens of times, but this time it wasn’t working and none of the Google results had a solution that helped.
It turns out I was pointing to the public key instead of the private key.
Short summary: Don’t point to the .pub keyfile with IdentityFile in .ssh/config.
A lot of the solutions I found were related to invalid keyfiles, but I’d generated the key with ssh-keygen on that machine, so I was fairly confident the keys were valid.
If you’re having the same problem, use
ssh -vvv
to get more debugging info.
If this saves someone else 20 minutes, my wasted time will not have been in vain.