SSH key: Permissions 0660 for '~/.ssh/id_rsa' are too open.

How to fix the 'Permissions 0660 for '~/.ssh/id_rsa' are too open' error when trying to login to your remote host using an SSH key

If you are trying to login to your remote host using a key but it doesn’t work and you get “Permissions are too open” error then this is for you.

1
2
3
4
Permissions [xxxx] for '~/.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.
bad permissions: ignore key: ~/.ssh/id_rsa

Permission of private keys should be set to 600. Run the following two commands from the .ssh directory.

1
2
chgrp Users id_rsa
chmod 600 id_rsa

All should be well now.