We help IT Professionals succeed at work.
Get Started
Troubleshooting Question

I keep getting an “WARNING: UNPROTECTED PRIVATE KEY FILE!” on Linux instance

Richard Comito
Last Modified: 2020-10-21
SSH questions with cmder on Windows 10.  When I SSH into an EC2 instance, I use chmod 400 anykey.pem and my .pem key is in my local OneDrive folder, everything works as advertised.  but if I move/create a new .pem  to any local folder or drive outside of the OneDrive folder, I keep getting an “WARNING: UNPROTECTED PRIVATE KEY FILE!” on Linux instance.  Does anyone know why this happens and if there is a fix?

Things that I have tried.
I looked in both folders, and the files both have -r--r--r-- permissions.

I have tried chmod 700 just to see what happens and it changes the permission and it gave me rw and all the others just r.  I then changed it back to 400

I tested both locations and C:\Users\username\OneDrive\folder\folder.pem this location works fine.  C:\source\repo\folder\folder.pem does not work.  Same .pem file with the same -r--r--r-- permissions.

Thank you

Watch Question
Software Engineer
Distinguished Expert 2019
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE