AWS亚马逊ssh登录失败 Permissions 0644 for .pem are too open

说明

AWS亚马逊ssh登录失败 Permissions 0644 for .pem are too open

ssh -i yourPath/yourPrivateKey.pem [email protected]

Warning: Permanently added 'yourAwsAddress.compute.amazonaws.com,00.00.00.00' (ECDSA) to the list of known hosts.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'yourPrivateKey.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 "yourPrivateKey.pem": bad permissions
[email protected]: Permission denied (publickey).

解决方法

问题在于yourPrivateKey.pem的权限为可读可写,如下

$ ll
total 24
-rw-------@ 1 zgpeace  staff   1.7K Feb 18 07:24 yourPrivateKey.pem

解决为修改为只读权限即可

$ chmod 400 yourPrivateKey.pem

$ ll
total 24
-r--------@ 1 zgpeace  staff   1.7K Feb 18 11:24 yourPrivateKey.pem

在初始化系统的时候,引导也有说明
在这里插入图片描述

参考

https://stackoverflow.com/questions/8193768/trying-to-ssh-into-an-amazon-ec2-instance-permission-error

发布了147 篇原创文章 · 获赞 13 · 访问量 2万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章