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.

By Victor Leung

Experience in software development, consulting services and technical product management. Understanding of business and technology with an MBA in Finance and a Master degree in Computer Science. AWS Certified Solution Architect with experience in building products from scratch and serving as a charismatic leader.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.