When you are trying set up SSH access to an AWS instance with your private key, sometimes you may run into errors:
Received disconnect from xxx.xxx.xxx.xxx: 2: Too many authentication failures for ubuntu
The error message you get from that is not very helpful generally.
Things you can try is to add ‘-v’ to the SSH command, it will give you more debug information.
However, those debug information is still not enough and misleading.
To get an absolute real problem, you should get into the remote box and read the auth.log file – this will give you exact errors you are having, which makes this kinda of problems much easy to fix.
tail -f /var/log/auth.log