How to avoid repeatedly being asked for SSH passphrase on macOS
25 July 2024 (Updated 6 January 2026)
If you keep getting asked to enter your SSH passphrase when doing SSH-related things like a git pull:
Enter passphrase for key '/Users/<account-name>/.ssh/id_ed25519':
Run the below:
eval $(ssh-agent) && ssh-add
Ensure you have the below entry in your ~/.ssh/config file:
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
Add your key to the macOS keychain:
ssh-add --apple-use-keychain ~/.ssh/id_ed2551
Now, try opening a new terminal tab and running git pull again. You shouldn’t be asked to enter your passphrase again.
Tagged:
macOS