SSH: Resolve error: Warning: unprotected private key file!

In this tutorial, I will explain how to resolve the following error : Warning: unprotected private key file! when you try to SSH from Linux to another SSH server with a private key set.

When you try to connect via ssh with a private key, you get this message:

Chances are you created the file yourself. /home/<user>/.ssh/id_rsa to use a set of keys you already owned.

This error occurs because the rights on the file /home/<user>/.ssh/id_rsa are too permissive.

To solve the problem change the permissions of the id_rsa file which contains the private key:

sudo chmod 600 id_rsa

Once the permissions are changed, you will be able to use your private key.




Leave a Comment