問題
Permissions 0644 for 'xx.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 "xx.pem": bad permissions ec2-user@35.77.46.6: Permission denied (publickey,gssapi-keyex,gssapi-with-mic). lost connection
解決方案
看日志報出的錯誤,"Permissions 0644 for 'xx.pem' are too open",pen文件的權(quán)限太大太open了。
使用ll(ls -al)命令查看了私鑰文件的權(quán)限却紧,發(fā)現(xiàn)和錯誤一樣诵肛,是644
所以需要使用chmod命令修改文件的權(quán)限
chmod 600 xx.pem
之后再嘗試一遍邀桑,完美執(zhí)行