Table of Contents

Fix Permissions for Private Key are Too Open with SSH

Cyrus Kao
Last modified on .

The default file permission on Linux is 777, which means everyone can read, write and execute the file. It's fine for most of the scenario, but it's another story when it comes to SSH private key. If you try to establish an SSH connection with a too open private key, WARNING: UNPROTECTED PRIVATE KEY FILE! will be shown.

Error message
openssh with a permissions too open key


To solve the problem is quite easy, simply change your SSH private key's permissions.

In the following, we will take ~/.ssh/id_rsa as an example, change it to your actual key path.

Read and Write

Or grant read and write permissions to the owner:

$ sudo chmod 600 ~/.ssh/id_rsa


Sign in to leave a comment.