跳到主要內容

AWS EC2 出現 ' *******.pem' are too open.

今天很難過,因為GCP 2個月免費試用到期了,所以就試了  AWS, 如果Adsense 收入有100usd 我就立馬付費租用 GCP .....,  扯遠了 ,設定好aws 系統後 ,下載了ssh key 想要用 ubuntu Client  連結時出現了以下問題.


ssh -i "Helloworld.pem" ubuntu@ec2-35-165-227-222.us-west-2.compute.amazonaws.com



@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0664 for 'Helloworld.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 "Helloworld.pem": bad permissions
Permission denied (publickey).


查詢後發現是因為權限問題,切換到pem 資料夾底下, 右鍵開啟terminal ,改一下ssh key權限就可以了


chmod 400  Helloworld.pem




jasonwu513@jasonwu513-desktop:~/桌面/AWS KEY$ ssh -i "Helloworld.pem" ubuntu@ec2-35-165-227-222.us-west-2.compute.amazonaws.com
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-105-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Sat Dec 17 08:31:02 UTC 2016

  System load: 0.16              Memory usage: 5%   Processes:       82
  Usage of /:  10.1% of 7.74GB   Swap usage:   0%   Users logged in: 0

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.



The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.



留言