If you received an email titled Notice: Bitbucket Cloud SSH host key rotation complete then you may need to update your SSH Host keys on your server. I didn’t read the contents of this email until I tried to do a pull from my company’s Advertise Me bitbucket repository for our digital signage solution software called AdvertiseMe.TV

When I tried to do a pull I received an error message with the following message:

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could be evesdropping 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:460SHA1Rmj8E8ERTC6xkNcmGOw9oFxYr0WF6zWW811E.

Please contact your system administrator.

Add correct host key in /root/.ssh/known_hosts to get rid of this message.

Offering RSA key in /root/.ssh/known_hosts:3

remote with:

ssh-keygen -f “/root/.ssh/known_hosts” -R “bitbucket.org”

RSA host key for bitbucket.org has changed and you have requested strict checking.

Host key verification failed.

HOW TO FIX ATLASSIAN BITBUCKET SSH HOST KEYS warning message

I decided to read the email and clicked on the instructions in the link.

Hello Bitbucket Cloud users,
As announced previously, we rotated Bitbucket Cloud’s RSA SSH host key today, June 20, 2023, at 1700 UTC.
If you did not transition your SSH clients to use ECDSA or Ed25519 SSH keys and are experiencing broken connections to bitbucket.org, please follow the instructions here.

HOW TO FIX ATLASSIAN BITBUCKET SSH HOST KEYS email

The link to the instructions has all the details you need to understand what the issue was and how to fix it.

HOW TO FIX ATLASSIAN BITBUCKET SSH HOST KEYS instructions message

In my case I followed these instructions:

HOW TO FIX ATLASSIAN BITBUCKET SSH HOST KEYS instructions steps message

From the instructions I used both commands:

ssh git@bitbucket.org host_key_info and ssh-keygen -R bitbucket.org && curl https://bitbucket.org/site/ssh >> ~/.ssh/known_hosts
HOW TO FIX ATLASSIAN BITBUCKET SSH HOST KEYS host key info message

It initially seemed to have worked but when I ran tried to pull or checked the host_key_info I received this message

Offending key for IP in /root/.ssh/known_hosts:3

Matching host key in /root/.ssh/known_hosts:7

Are you sure you want to continue connecting (yes/no)?

HOW TO FIX ATLASSIAN BITBUCKET SSH HOST KEYS host key info offending and matching key

If you don’t want to be prompted with this message all the time, you can do the following:

Run the command ssh-keygen -f “/root/.ssh/known_hosts” -R “bitbucket.org” this will remove the bitbucket host key entry from bitbucket. You can do this before you get the host key info

Manually delete the entry from the known_hosts file

HOW TO FIX ATLASSIAN BITBUCKET SSH HOST KEYS remove bitbucket host file
HOW TO FIX ATLASSIAN BITBUCKET SSH HOST KEYS remove bitbucket host file list

Delete all the entries in the known_hosts file but make sure you back up the file first

HOW TO FIX ATLASSIAN BITBUCKET SSH HOST KEYS host key info message working

You then need to run the ssh commands from the first option again and you will no longer receive the error messages. You can also watch this video for more help:

I hope this helps and if you need any further help please leave a comment and I’ll get back to you when I can. Also if you need help with git you may want to read this article: LEARNING ABOUT GIT REPOSITORY

If this article helped you in any way and you want to show your appreciation, I am more than happy to receive donations through PayPal. This will help me maintain and improve this website so I can help more people out there. Thank you for your help.

HELP OTHERS AND SHARE THIS ARTICLE


1Shares

LEAVE A COMMENT


Subscribe to my newsletter where I will share my journey in affiliate marketing, business, technology, fitness and life in general. Hopefully, this motivates you to also change your journey in life.

Subscribe to my newsletter where I will share my journey in affiliate marketing, business, technology, fitness and life in general. Hopefully, this motivates you to also change your journey in life.