[SSH] Resolving WARNING: UNPROTECTED PRIVATE KEY FILE!
by Riley MacDonald, August 25, 2018

When upgrading my development machine I backed up my ~/.ssh directory so I would still have access to all of my development tools and servers. Unfortunately when attempting an ssh connection I received the following error:

$ ssh [user@some_server_address]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0775 for '/home/user/.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.
Load key "/home/user/.ssh/id_rsa": bad permissions
[user@some_server_address]: Permission denied (publickey).

Unfortunately my backup modified the file permissions which now violates the contract. This issue can be resolved by changing the file permissions back to 600:

~/.ssh $ sudo chmod 600 id_rsa
~/.ssh $ sudo chmod 600 id_rsa.pub
Open the comment form

Leave a comment:

Comments will be reviewed before they are posted.

User Comments:

Be the first to leave a comment on this post!