Scp using public key

You are correct here. I would suggest using a specific key that you generate on the server(s) that you are deploying to rather than using “your” key.

We encrypt the data at rest, and the web form is over TLS so there is no significant risk of uploading and using the key this way.

What I typically do is:

  1. Log into my server that I want CircleCI to deploy to as the user that is going to be doing the deployment (not root).
  2. Run ssh-keygen
  3. Copy ~/.ssh/id_rsa to the CircleCI web form
  4. Copy ~/.ssh/id_rsa.pub to authorized_keys

Best,
Lev

1 Like