For some strange reason, the first time I added my private key to CircleCI SSH permissions, it was able to SSH into my VPS and run a bash script. Subsequent builds, I get permission denied even though I didn’t change the keys.
Here is my config.yml
How I created and added my keys:
In a linux terminal, I created my SSH key using
ssh-keygen -m PEM -t rsa -C "email@example.com" with my email. I copied the key in id_rsa to my CircleCI settings SSH permissions with the hostname blank. I then copied the key in id_rsa.pub to my VPS’s
When debugging with SSH enabled, I SSH into the box and generated another pair of SSH keys. Copied the public key to my VPS authorized keys, and tried to SSH from the box but also got permission denied.
What I want to do is after my build, upload artifacts, and then SSH into my VPS to download artifact, unpack it, run npm commands (install, migrations, etc.) and restart my node server.
I’m all out of ideas, especially as to why the first time worked but subsequent tries did not. Am I doing something wrong here?