Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Host key verification failed - ssh and known hosts set

Mylene Kreiger November 17, 2022

Hi everyone :)

I have a typo3 project wich I want to deploy on my server via bitbucket pipeline and deployer. Everything works fine until the actual deploy on server. I always get an error "host key verification failed". 

I added a new ssh key pair in the pipeline, copied the public to my hosting provider for access, added the know hosts via bitbucket as IP-address and url with the right port:

Bildschirm­foto 2022-11-18 um 08.30.26.png
Unfortunately my hosting provider only allows ssh for approved IP-addresses. Therefore I added all IP-addresses concerning bitbucket to the approved ones.

After all these arrangements I still get the same error and I really don't know what I am doing wrong. Would really appreciate it, if someone could help me :D

I am really sorry if I forgot some important informations, this is my first post in the community. I will provide them as quick as possible.

Greetings, Mylene

1 answer

1 accepted

1 vote
Answer accepted
Erez Maadani
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 Leaders.
November 18, 2022

Hey @Mylene Kreiger 

Before deploying your server, try printing the contents of the known hosts file:

 cat ~/.ssh/known_hosts

This way you can verify the file contains the key for the requested server.

If it's not, you can try and add it manually during the pipeline. 

echo $(ssh-keyscan -t rsa bitbucket.org) >> ~/.ssh/known_hosts
Mylene Kreiger November 18, 2022

Thanks @Erez Maadani  for your fast answer :)

 

I have added the printing and it seems bitbucket.org is in the known hosts, but still the same error. How is this possible?

Bildschirm­foto 2022-11-18 um 09.59.41.png

Erez Maadani
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 Leaders.
November 18, 2022

Try the second command again but use your server URL/IP instead of bitbucket.org:

echo $(ssh-keyscan -t rsa your-server-url-here) >> ~/.ssh/known_hosts
Mylene Kreiger November 18, 2022

Thanks, that worked!

Daniel Fuentes October 10, 2023

Thank you so Much @Mylene Kreiger & @Erez Maadani it work for me also!!!!

Like Mylene Kreiger likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events