I needed a new key pair for my AWS account. I encountered this error after creating a new AWS Key Pair.

ssh -i ~/Desktop/burkey.pem ubuntu@           
The authenticity of host ' (' can't be established.
ECDSA key fingerprint is SHA256:UxRi6jxC4zljwQrpPPgEKo5NL2Y5kCp5PIrVNU0HpJ4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (ECDSA) to the list of known hosts.
Permissions 0644 for '/Users/aburke/Desktop/burkey.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/Users/aburke/Desktop/burkey.pem": bad permissions
ubuntu@ Permission denied (publickey).

The files permissions of 600 mean that the owner has full read and write access to the file, while no other user can access the file. Permissions of 644 mean that the owner of the file has read and write access, while the group members and other users on the system only have read access.

A quick chmod 600 ~/Desktop/burkey.pem and we’re cooking with gas.