SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
Security New Added 8 September 2026

SSH: Permissions 0644 for 'id_rsa' are too open

OpenSSH refuses to use a private key that other users on the machine can read. It appears constantly in CI, where a key written from a secret inherits the default umask, and on keys copied from a filesystem that does not carry Unix permissions.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
chmod 600 ~/.ssh/id_ed25519
chmod 700 ~/.ssh
chmod 644 ~/.ssh/id_ed25519.pub ~/.ssh/known_hosts

# CI: set the mode as you write the file
install -m 600 /dev/null ~/.ssh/id_ed25519
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519

# Better in CI: hold the key in an agent and never write it to disk
eval "$(ssh-agent -s)"
ssh-add - <<< "$SSH_PRIVATE_KEY"

# Mounted volumes that cannot express modes: mount with file_mode=0600

How to diagnose Security errors

Security errors are usually a control working correctly. A rejected JWT, a CSP violation, an SELinux denial or a host key mismatch is the system telling you an invariant was broken, and the right response is to understand the invariant, never to disable the control. Two of these deserve special caution: an SSH host key mismatch can indicate a genuine interception, and JWT algorithm confusion is an active exploitation technique, not a configuration nuisance.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Decode tokens locally and check exp, nbf, iss and aud. Never paste a live token into an online decoder. It is a credential.
  2. Pin the accepted JWT algorithm explicitly on the verifying side. Accepting whatever the token's header claims is the algorithm-confusion vulnerability.
  3. For SELinux, read the actual denial: ausearch -m avc -ts recent | audit2why. Set the correct file context with semanage fcontext rather than running setenforce 0.
  4. For CSP violations, read the browser console message. It names the exact directive and blocked URI. Add the specific source, not a wildcard.
  5. For an SSH host key mismatch, verify the new fingerprint out of band before removing the old key. This warning exists to catch man-in-the-middle attacks.

Tools worth reaching for

  • ausearch / audit2why
  • openssl x509 -noout -text
  • ssh-keygen -lf
  • browser CSP console reports
  • local JWT decoding

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

man.openbsd.org

Related Security errors

See all 25 Security errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.