wrong passphrase 3 times: git doesn't ask for passphrase anymore
Things look complicated enough that it may be worth starting all over:
- 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).
- If ~/.ssh/config exists, check that it doesn't have suspicious lines.
- If you are using ssh-agent, remove all keys using
ssh-add -D
. Check that there are no keys usingssh-add -l
. If you see any output, you are suffering from this bug. Log out, log in, and verify thatssh-add -l
produces no output. - Run
ls -al ~/.ssh
and check that there are no keys there. - 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. - Run
ls -al ~/.ssh
and check that id_rsa and id_rsa.pub exist. - Remove existing keys from Bitbucket.
- Add the contents of ~/.ssh/id_rsa.pub to Bitbucket.
- Test the connection using
ssh -T git@bitbucket.org
. If it fails, post the output ofssh -vvv git@bitbucket.org
. - Check that git commands works.
Why is it looking for
id_dsa
instead ofid_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.