How to store your GitHub Passphrase, so Cursor doesn't keep asking

To stop Cursor (or your terminal) from asking for the SSH key passphrase every time, you need to add your key to the SSH agent and optionally store it in the macOS Keychain. Here’s how:

Start a SSH Agent

Run the following command in your terminal:

eval "$(ssh-agent -s)"

Add Your SSH Key to the Agent

Now, add your key to the SSH agent (assuming an ed25519 SSH Key hereand store it in the macOS Keychain:

ssh-add --apple-use-keychain ~/.ssh/id_ed25519

This ensures your passphrase is stored and won’t be asked every time. Again, assuming an ed25519 SSH Key here.

Make Sure macOS Uses the Keychain Automatically

Edit (or create) your SSH config file:

nano ~/.ssh/config

Then, add the following lines:

Host *
  UseKeychain yes
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_ed25519

Save and exit (Ctrl + X, then Y, then Enter).

Test Your SSH Connection

Run:

ssh -T git@github.com

If successful, you should see:

Hi <your-username>! You've successfully authenticated...

From now on, your passphrase should not be requested every time you use Git.

Let me know if it helped!