-
Type:
Suggestion
-
Resolution: Unresolved
-
Component/s: Pipelines - SSH Keys
-
None
-
1
Issue Summary
Bitbucket Cloud is transitioning SSH access from bitbucket.org to ssh.bitbucket.org (as announced Upcoming change to Bitbucket Cloud SSH access: move from bitbucket.org to ssh.bitbucket.org). However, the default known_hosts file provided by Bitbucket Pipelines (both Cloud and Self-hosted runners) currently only contains fingerprints for bitbucket.org and github.com.
When users attempt to use the new ssh.bitbucket.org endpoint within a pipeline, the connection fails with a "Host key verification failed" error unless they manually intervene.
Steps to Reproduce
- Use the following command in the Pipeline
ssh -T git@ssh.bitbucket.org
- Run the Pipeline
Expected Results
Pipeline build should complete with success
Update the Bitbucket Pipelines runner environment to include the public host keys for ssh.bitbucket.org in the global /root/.ssh/known_hosts (or equivalent) file by default.
Actual Results
Pipeline build fail with following error
Host key verification failed.
Pipeline build default known_hosts file provided by Bitbucket Pipelines (both Cloud and Self-hosted runners) currently only contains fingerprints for bitbucket.org and github.com.
Workaround
Users currently have to add the following to their pipeline scripts:
curl -s https://bitbucket.org/site/ssh | sed 's/bitbucket.org/ssh.bitbucket.org/' >> ~/.ssh/known_hosts