Search code examples
herokussh-keys

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


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

Solution

  • 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