SSH: Fix Unprotected Private Key Error

The problem

When I download the .pem file to ssh my AWS instance, I encountered the following error:

WARNING: UNPROTECTED PRIVATE KEY FILE!

Permissions 0640 for ‘blog.pem’ are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: blog.pem Permission denied (publickey).

The Solution

Run this command in your terminal

ssh -i xxx.pem root@52.74.3.53

Replace xxx.pem with your .pem file name

This will change the keys to be only readable by you.


Originally published at victorleungtw.com on May 29, 2015.

victorleungtw

Years of experience delivering enterprise projects with global stakeholders in banking, airline and gaming industries involving a broad range of technologies. Provide consulting services at both executive and operational levels, including strategy and data analysis. Lead web and mobile app development team with hands-on coding implementation. Manage projects as Certified Scrum Master with Agile techniques. Qualification with master degree in Computer Science and pursuing MBA degree in Finance.

Leave a Reply

Close Menu