Your key file must not be publicly viewable for SSH to work. Use this command if needed: chmod 400 mykey.pem code example
Example 1: Load key ".pem": bad permissions
chmod 400 ~/.ssh/mykeyfile.pem
Example 2: change permissions pem
chmod 400 key.pem