Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CircleCI 2.0 SSH debug: Failed to enable SSH, No SSH key is found

Tags:

circleci

Config:

  • CircleCI 2.0
  • Bitbucket private repo

After I click on "Rebuild with SSH", the "Enable SSH" section outputs

Failed to enable SSH No SSH key is found. Please make sure you've added at least one SSH key in your VCS account.

What does this mean? How do I fix this?

like image 543
Carson Ip Avatar asked Sep 05 '17 05:09

Carson Ip


2 Answers

You can use your personal private public id_rsa id_rsa.pub key-pair (which you may already generated to SSH access to other machines)

just add your public key ~./ssh/id_rsa.pub to Bitbucket -> Settings -> SSH keys -> add SSH key

then go to CircleCI and rebuild the project.


There may be confusion because CircleCi uses other SSH key called checkout SSH key-pair for:

  • checking out the main project
  • checking out any Bitbucket-hosted submodules
  • checking out any Bitbucket-hosted private dependencies
  • automatic git merging/tagging/etc.

Private checkout SSH key is saved on circleCi servers and public key is automatically uploaded to Bitbucket.

like image 89
Jirik Avatar answered Oct 17 '22 06:10

Jirik


If you're using Github:

  • go to your keys setting: https://github.com/settings/keys
  • generate a key pair if you don't have one
  • copy and paste the key in the CircleCI UI and save.

You should immediately be able to log in with SSH into the CircleCI now (run rerun job with SSH).

If you're using Bitbucket:

  • Add your public key to your bitbucket account: choose Bitbucket settings from your avatar in the lower left
  • Click ssh keys and add your public key
  • You don't need to do anything in CircleCI, simply re-run the job using SSH

sources:

  • https://confluence.atlassian.com/bitbucket/troubleshoot-ssh-issues-271943403.html
like image 2
michelepatrassi Avatar answered Oct 17 '22 06:10

michelepatrassi