Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "Warning: unprotected private key file!" error message while attempting to import SSH key [closed]

Can someone explain this to me please and what I can do to sort out my permissions issue. It seems to be stopping me from getting the authenticity of host heroku and fixing my keys issues.

david@daniel-Inspiron-531:~$ ssh-add david/.ssh/id_rsa @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0775 for 'david/.ssh/id_rsa' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. david@daniel-Ins 
like image 320
David Avatar asked Sep 16 '14 12:09

David


People also ask

What is unprotected private key file?

The reason the "Warning: Unprotected Private Key File" AWS error occurs is because we're trying to SSH into an EC2 instance using a private key that allows read access to other users. A private key must only be readable by your user on the machine in order to allow you to SSH into an EC2 instance.

How do I create an SSH key?

Open a terminal and use the ssh-keygen command with the -C flag to create a new SSH key pair. Replace the following: KEY_FILENAME : the name for your SSH key file. For example, a filename of my-ssh-key generates a private key file named my-ssh-key and a public key file named my-ssh-key.


1 Answers

I would recommend you to re create a set of keys using

ssh-keygen -t rsa -C '<email>' 

for a more secure system. Else changing the permissions to something less open would do.

To change permissions, use

chmod  400 ~/.ssh/id_rsa 
like image 101
rjv Avatar answered Sep 19 '22 13:09

rjv