aws Permission denied (publickey)

load pubkey "/home/fedora/.ssh/Ubuntu_Amazon_Demo.pem": invalid format
The authenticity of host 'ec2-54-67-59-59.us-west-1.compute.amazonaws.com (54.67.59.59)' can't be established.
ECDSA key fingerprint is SHA256:/fgKCCncW76YVwXlzYHzEyG+dqcJNAQIH7C7BUYUq5A.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: yes
Warning: Permanently added 'ec2-54-67-59-59.us-west-1.compute.amazonaws.com,54.67.59.59' (ECDSA) to the list of known hosts.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/home/fedora/.ssh/Ubuntu_Amazon_Demo.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 "/home/fedora/.ssh/Ubuntu_Amazon_Demo.pem": bad permissions
ubuntu@ec2-54-67-59-59.us-west-1.compute.amazonaws.com: Permission denied (publickey).

解决方法:

重新设置权限 

chmod 400 /home/fedora/.ssh/Ubuntu_Amazon_Demo.pem

原文地址:https://www.cnblogs.com/profesor/p/13912452.html