scp到服务器时报错Permissions 0644 for 'xx.pem' are too open.

问题

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文件的权限太大太open了。
使用ll(ls -al)命令查看了私钥文件的权限,发现和错误一样,是644
所以需要使用chmod命令修改文件的权限

chmod 600 xx.pem
之后再尝试一遍,完美执行

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容