SSH: How to Fix the 'Unprotected Private Key' Error

June 28, 2015

The Problem

2015 06 28

When I downloaded the .pem file to SSH into my AWS instance, I encountered the following error:


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

To resolve this issue, run the following command in your terminal:

ssh -i xxx.pem root@

Replace xxx.pem with the name of your .pem file.

This command will modify the permissions on the keys, making them readable only by you.

Profile picture

Victor Leung, who blog about business, technology and personal development. Happy to connect on LinkedIn