macOS: Enter passphrase for key '/Users/me/.ssh/id_ed25519': (every time after restart)
macOS doesn't automatically reload SSH keys into the agent after a restart unless configured to use the keychain.
Enter passphrase for key every time macOSssh-add -K is deprecated: use --apple-use-keychainWarning: The -K and -A flags are deprecated and have been replaced by the --apple-use-keychain and --apple-load-keychain flagsssh agent keys lost after reboot macOSThe agent has no identities. Meaning
Add to ~/.ssh/config: Host * with AddKeysToAgent yes, UseKeychain yes, IdentityFile ~/.ssh/id_ed25519, then run ssh-add --apple-use-keychain ~/.ssh/id_ed25519 once. On macOS 12+ -K is replaced by --apple-use-keychain.
Common causes
- No
UseKeychain yes/AddKeysToAgent yesin ssh config - Key added without keychain flag
- Using Homebrew ssh that ignores UseKeychain
- Moved the key file
- New key without passphrase stored
⚡ Quick fix
ssh-add --apple-use-keychain ~/.ssh/id_ed25519- Add
AddKeysToAgent yes+UseKeychain yesto ~/.ssh/config - Use Apple's
/usr/bin/ssh
Detailed fix by platform
macOS
ssh-add -llists loaded keys;ssh-add --apple-load-keychainreloads keychain keys
How to diagnose
- Config — UseKeychain set?
- Added — With keychain flag?
- ssh — Apple binary?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Bad configuration option: usekeychain ssh: /Users/me/.ssh/config: line 5: Bad configuration option: usekeychain
- client_loop: send disconnect: Broken pipe client_loop: send disconnect: Broken pipe (SSH session drops when idle)
- git: 'credential-osxkeychain' is not a git command Git: git: 'credential-osxkeychain' is not a git command. See 'git --help'
Most viewed in macOS
- is damaged and can’t be opened macOS: “App” is damaged and can’t be opened. You should move it to the Trash.
- Operation not permitted (macOS privacy) macOS: Operation not permitted — Terminal/app lacks Full Disk Access (TCC privacy protection)
- zsh: command not found: brew macOS: zsh: command not found: brew (Homebrew not on PATH on Apple Silicon)
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026