Add valid permissions on .ssh folder and key files in *nix systems
To enable Linux/BSD systems to correctly work with you ssh
keys - you need to set valid permissions for that files.
Typically you want the permissions to be:
-
.ssh
- directory to have0700
-
*.pub
- public keys to have0644
-
id_rsa
- private keys to have0600
Shortcut script to make that works
This few commands works for me:
chmod 0700 ~/.ssh
chmod 0644 ~/.ssh/*.pub
chmod 0600 ~/.ssh/id_rsa ~/.ssh/github_rsa
Tags: #unix ,
Created: 16. 8. 2022