Created
May 25, 2023 09:46
-
-
Save amaddio/d8401dcaaf479e6c856f860f33525265 to your computer and use it in GitHub Desktop.
update bitbucket ssh key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bitbucket changes keys on 20. Juni 2023. See: https://bitbucket.org/blog/ssh-host-key-changes | |
# check if the bitbucket ssh key is already in place | |
if [[ $(ssh git@bitbucket.org host_key_info | grep -c ybgmFkzwOSotHTHLJgHO0QN8L0xErw6vd0VhFA9m3SM) -eq 1 ]]; then | |
printf 'key is already correctly in place'; | |
else | |
# if the bitbucket ssh key is not in place, then add it | |
ssh-keygen -R bitbucket.org && curl https://bitbucket.org/site/ssh >> ~/.ssh/known_hosts | |
if [[ $(ssh git@bitbucket.org host_key_info | grep -c ybgmFkzwOSotHTHLJgHO0QN8L0xErw6vd0VhFA9m3SM) -eq 1 ]]; then | |
printf 'key has been added to your ~/.ssh/known_hosts file'; | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment