wrong passphrase 3 times: git doesn't ask for passphrase anymore wrong passphrase 3 times: git doesn't ask for passphrase anymore git git

wrong passphrase 3 times: git doesn't ask for passphrase anymore


Things look complicated enough that it may be worth starting all over:

  1. Remove all the keys in ~/.ssh that you don't need (if there are keys that you want to keep, consider moving them to a different directory for now).
  2. If ~/.ssh/config exists, check that it doesn't have suspicious lines.
  3. If you are using ssh-agent, remove all keys using ssh-add -D. Check that there are no keys using ssh-add -l. If you see any output, you are suffering from this bug. Log out, log in, and verify that ssh-add -l produces no output.
  4. Run ls -al ~/.ssh and check that there are no keys there.
  5. Create a new key using ssh-keygen. Press enter when it asks for the output file to use the default, then type the passphrase twice.
  6. Run ls -al ~/.ssh and check that id_rsa and id_rsa.pub exist.
  7. Remove existing keys from Bitbucket.
  8. Add the contents of ~/.ssh/id_rsa.pub to Bitbucket.
  9. Test the connection using ssh -T git@bitbucket.org. If it fails, post the output of ssh -vvv git@bitbucket.org.
  10. Check that git commands works.

Why is it looking for id_dsa instead of id_rsa?

SSH tries several keys until it finds one that works. It tried id_rsa, the key was rejected, so it went on to try id_dsa.

Credit to @Leon for mentioning ssh-add.


I forgot the passphrase and guessed wrong for multiple times. So I created a new one.

I read that as you had a key that worked, you created a new one and you are wondering why it does not work.

You need to copy the public key to the server's authorized_keys.