Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Warning: the ECDSA host key for 'bitbucket.org' differs

Manjunath B_V_
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 28, 2023

Hi Team,
     When i try to push code using git push cmd, I'm getting below error:


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:46OSHA1Rmj8E8ERTC6xkNcmGOw9oFxYr0WF6zWW8l1E.
Please contact your system administrator.
Add correct host key in /home/manju/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/manju/.ssh/known_hosts:5
remove with:
ssh-keygen -f "/home/manju/.ssh/known_hosts" -R "bitbucket.org"
RSA host key for bitbucket.org has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


Then i ran a cmd as below:
git ls-remote -h git@bitbucket.org:manjunathbv/cirrus-erp.git HEAD



After above cmd, i got the same worning and now when i push code i get a msg:
Warning: the ECDSA host key for 'bitbucket.org' differs from the key for the IP address '2406:da00:ff00::22cd:e0db'
Offending key for IP in /home/manju/.ssh/known_hosts:21
Matching host key in /home/manju/.ssh/known_hosts:29
Are you sure you want to continue connecting (yes/no)?

could you please help me with the same?

1 answer

0 votes
LynnG
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 1, 2026

This is a classic SSH host key mismatch issue. It usually happens when:

  • Bitbucket has rotated/changed its SSH host keys, or
  • You previously connected to a different server/IP that had a different key cached in known_hosts.

The important thing is to verify the new key is legitimate before accepting it.

 

What happened?

Initially SSH reported:

Plain Text
1
Offending RSA key in /home/manju/.ssh/known_hosts:5
2
remove with:
3
ssh-keygen -f "/home/manju/.ssh/known_hosts" -R "bitbucket.org"
Show more lines

After running additional commands, SSH now sees:

Plain Text
1
Warning: the ECDSA host key for 'bitbucket.org' differs from the key for the IP address '2406:da00:ff00::22cd:e0db'
2
Offending key for IP in /home/manju/.ssh/known_hosts:21
3
Matching host key in /home/manju/.ssh/known_hosts:29
Show more lines

This means your known_hosts file contains entries for both:

  • bitbucket.org
  • the resolved IPv6 address 2406:da00:ff00::22cd:e0db

and they don't match.

Fix

Remove the old Bitbucket entries:

Shell
1
ssh-keygen -R bitbucket.org
2
ssh-keygen -R 2406:da00:ff00::22cd:e0db
3
``
Show more lines

Or manually edit:

Shell
1
vi ~/.ssh/known_hosts
Show more lines

and delete the offending lines (21 and any old Bitbucket entries).

Re-add the host key

Test the connection:

Shell
1
ssh -T git@bitbucket.org
Show more lines

You should get something similar to:

Plain Text
1
The authenticity of host 'bitbucket.org' can't be established.
2
ECDSA key fingerprint is ...
3
Are you sure you want to continue connecting (yes/no)?
Show more lines

Before typing yes, compare the fingerprint shown with the official Bitbucket SSH fingerprints published by Atlassian:

https://support.atlassian.com/bitbucket-cloud/docs/configure-ssh-and-two-step-verification/

If the fingerprint matches Atlassian's documentation, type:

Plain Text
1
yes
Show more lines

This will create a fresh entry in ~/.ssh/known_hosts.

Verify

Run:

Shell
1
ssh -T git@bitbucket.org
Show more lines

You should see a successful authentication message.

Then try:

Shell
1
git push
Show more lines

again.

If it still fails

Please share the output of:

Shell
1
grep bitbucket ~/.ssh/known_hosts
Show more lines

and

Shell
1
ssh -vT git@bitbucket.org
Show more lines

(with any sensitive information removed), and I can pinpoint exactly which host key entry is causing the conflict.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events