Usual issues:
- Your key doesn't have restricted permissions, so openssh refuses to use it.
- You specified a non-existent key in the ssh config
Set proper permissions
# permission of the ssh dir itself
chmod 700 ~/.ssh/
# baseline permissions for all files in ssh dir
chmod 600 ~/.ssh/*
# set more open permissions for public keys in the ssh dir
chmod 644 ~/.ssh/*.pub
Debug ssh connection issues
ssh -v <host>– issues on your end (client)ssh -vv– good enough logs of both client and server sidessh -vvv– detailed logs from both client and server
ssh -vT <hostname>
v: verbose
T: Disable pseudo-terminal allocation
Eg: Debug why git via ssh isn't working:
ssh -vT [email protected]