Fix Permissions for Private Key are Too Open with SSH
Default file permissions 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 comes to SSH private key. If you try to establish a SSH connection with a too open private key,
WARNING: UNPROTECTED PRIVATE KEY FILE! will be shown.
To solve the problem is quite easy, simply change your SSH private key's permissions.
In the following will take
~/.ssh/id_rsaas example, change it to your actual key path.
Read Only (Recommended)
Change it to only readable by the owner:
sudo chmod 400 ~/.ssh/id_rsa Bash
Read and Write
Or grant read and write permissions to the owner:
sudo chmod 600 ~/.ssh/id_rsa Bash