Multiple ssh keys for same domain?

Hi,

For our deployment setup, we have different roles for different branches/environments, but on the same domain. For example the staging branch might deploy with staging@our-domain.com and production with production@our-domain.com. When I add ssh keys to the UI in CircleCI, adding a second key for our-domain.com seems to overwite the first one. Is there any way to have both live in harmony?

Thanks,
Asher

1 Like

I believe that if you leave out the domain portion it will have both keys available during the build and use the one that works.

Thanks, that makes sense. I’ve tried adding the private key from ~/.ssh/id_rsa on my server to the project’s SSH Permissions->SSH Keys, but during the deployment step, it’s asking for the server password, so it must not be working. Is there anything else I need to do to enable it?

Edit: Nevermind, it worked!

1 Like