I am trying to add my ssh private key file to a Mac in the terminal. When I run:
ssh-add -k / /path/filethis is the error I'm getting:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/Volumes/CREATIF IV/Creatif IV/Creatif IV_web/Personal/ssh-keys/anker/anker-prv_key.ppk' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.How to fix it?
2 Answers
As a general rule, private keys should only be manageable by the owner, optionally for the group (for example, if it has to be managed by apache2, it can be readable by the ssl-cert group) and have no permissions for the group and the others. So:
chmod 600 "/Volumes/CREATIF IV/Creatif IV/Creatif IV_web/Personal/ssh-keys/anker/anker-prv_key.ppk"Should be enough in this case.
4Normally you should assign the right permission for the file (chmod 600 file), but since it's on your external drive which could not support permissions, try adding it from the standard input to bypass the permission checks, for example:
cat "/Volumes/path/prv_key.ppk" | ssh-add -k/ -