Debug with SSH from API without Github/Bitbucket

Hi all,
Is there a possible way of adding public keys via the API that are not from Github/Bitbucket and then be able to debug via SSH using the public keys that were added on Circle?

Or is Circle’s behavior to always check public keys from Github/BB and only use them public keys?

Thanks.

Hmm, interesting question. I have not tried this, and I doubt there would be much demand for it.

You could try creating a new user key in the Checkout SSH Keys section. Or you could Base64 encode a key and then use add_ssh_keys to install it. See https://circleci.com/docs/2.0/configuration-reference/#add_ssh_keys.

Hi, thanks for your reply.
The new user key in the Checkout SSH keys uses this command:

curl -X POST --header “Content-Type: application/json” -d ‘{“type”:“github-user-key”}’ https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/checkout-key?circle-token=:token

These require a VCS type of either Bitbucket/Github.

Additionally the add_ssh_keys needs to be added to the config.yml in the VCS system itself, which is not what I’m looking for, I need a solution which relies on Circle’s API.

You’re correct about there not being more demand for this however, I’m not sure this functionality exists within Circle.

Ah, I missed that you wanted to use the API for this, apologies. I am not sure it is possible in the UI either. You could add this to circleci.com/ideas if it is not there already.

1 Like