Services Spotlight:

How-To Fix “WARNING: UNPROTECTED PRIVATE KEY FILE!” on Mac & Linux

Written By Corlew Solutions
Updated June 19, 2014
Published June 18, 2014
Why Corlew Solutions?

We write great software and provide amazing technical support. Contact us today if you need help with a software project:

  • Website: Send an inquiry
  • Email:
  • Phone: (703) 688-3058

Article Technology Info

This article discusses the following technologies:

  • Linux - A Unix-like open source operating system

Have you run into the following error message in your Mac or Linux terminal?

1
2
3
4
5
6
7
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0744 for '/home/corlewsolutions/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /home/corlewsolutions/.ssh/id_rsa

This warning message is related to the permissions on the .ssh folder and files inside of it. Mac and Linux operating systems may complain about these permissions if they are not set correctly. Fortunately, if you have received this warning, it’s easy to fix.

First, let’s set the permissions on the .ssh directory itself.

1
sudo chmod 755 ~/.ssh # The owner my do anything.  All others may list files, but cannot create/delete files.

Next, let’s change the permissions on some of the files in the directory:

1
2
3
4
cd ~/.ssh
sudo chmod 644 known_hosts  # The owner may read/write.  All others may only read.
sudo chmod 600 id_rsa  # The owner may read/write.  No access for anyone else.
sudo chmod 600 id_rsa.pub  # The owner may read/write.  No access for anyone else.

We hope you found this article useful. If you see any mistakes, missing features or ways to improve it, please let us know in the comments below so we can update its contents. If you're willing to link to us, we would sincerely appreciate it!

Corlew Solutions is a Web Design and Web Application Development company based in Fairfax Virginia, minutes away Washington D.C. If you're looking for great web design from the Northern Virginia area or web design from the Washington D.C. area we can help. Contact Us today!

comments powered by Disqus