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.
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.
The link to the instructions has all the details you need to understand what the issue was and how to fix it.
In my case I followed these instructions:
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
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)?
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
Delete all the entries in the known_hosts file but make sure you back up the file first
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
LEAVE A COMMENT
I am an entrepreneur based in Sydney Australia. I was born in Vietnam, grew up in Italy and currently residing in Australia. I started my first business venture Advertise Me from a random idea and have never looked back since. My passion is in the digital space, affiliate marketing, fitness and I launched several digital products. You will find these on the portfolio page.
I’ve decided to change from a Vegetarian to a Vegan diet and started a website called Veggie Meals.
I started this blog so I could leave a digital footprint of my random thoughts, ideas and life in general.
If any of the articles helped you in any way, please donate. Thank you for your help.
Affiliate Compensated: there are some articles with links to products or services that I may receive a commission.