Set Proper File Permissions
The fastest way to secure your SSH keys is ensuring correct file permissions that prevent unauthorized access.
- 1 Open terminal and navigate to your SSH directory: cd ~/.ssh
- 2 Set private key permissions: chmod 600 id_rsa
- 3 Set public key permissions: chmod 644 id_rsa.pub
- 4 Secure the SSH directory: chmod 700 ~/.ssh
- 5 Verify permissions: ls -la
> chmod 600 ~/.ssh/id_*
> chmod 644 ~/.ssh/*.pub
> chmod 700 ~/.ssh