Resolving OpenSSH Private Key Error on Windows: Easy Fix

Discover a step-by-step guide to fixing the ‘Unprotected private key file’ error in OpenSSH on Windows.

Photo by regularguy.eth on Unsplash

If you encounter the “WARNING; Unprotected private key file” error when using a private key with OpenSSH on Windows, you can take the steps below to resolve the issue.

For example, If you are going to use your .pem file to connect your AWS EC2 Linux instance using your Windows OS, it will show the error given below saying that:

> ssh -i "trex-dino.pem" [email protected]

It throws the following sets of errors.

Code snippet by Author - Taken from cmd (Copy-pasting from CMD)
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'trex-dino.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 "trex-dino.pem": bad permissions
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Leave a Reply