Fix "Permissions too open" on SSH Private Keys

Set owner-only permissions on your SSH private key with chmod 600 so ssh will use it and other users can't read it.

LinuxchmodsshpermissionssecurityMedium risk
Run chmod 600 ~/.ssh/id_ed25519 (and 700 on ~/.ssh) to make ssh accept your private key again.

01Command

Command
$ chmod 600 ~/.ssh/id_ed25519 && ls -l ~/.ssh/id_ed25519

02What it does

SSH refuses to use a private key that other users on the system could read — this is deliberate, because a world-readable key is effectively leaked. chmod 600 gives only the owner read/write access; the .ssh directory itself should be 700 and the matching .pub file can stay 644. If you manage several keys, apply the same fix to every private file in ~/.ssh, and never relax these permissions again — warnings like "UNPROTECTED PRIVATE KEY FILE" always mean the mode is too open.

03Risk

RiskMedium risk
!Warning: If a private key was ever readable by others (0644, synced by cloud folders, or pasted anywhere), treat it as compromised and generate a new key pair rather than just fixing the mode.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: Security & Privacy

06Related solutions