Configuring my cloud server to use
Generate a codefresh public/private key pair on catness
-
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa_codefresh
CHANGED
-
ssh-keygen -t ed25519 -f ~/.ssh/id_rsa_codefresh
Setup codefreshrunner user on my server and give it permission to run docker:
-
sudo adduser codefreshrunner
-
sudo usermod -a -G docker codefreshrunner
Login as that user and check they can run docker commands
-
mkdir ~/.ssh
-
echo KEY > ~/.ssh/authorized_keys
Logout and check login works using key (run on catness)
-
ssh -o "IdentitiesOnly=yes" -i ~/.ssh/id_rsa_codefresh codefreshrunner@metcarob.com -p XXXX
On catness run
-
cat ~/.ssh/id_rsa_codefresh | tr '\n' ','
Copy and past this into the SSH_KEY value in the pipeline.
DEBUG
Connect from catness:
-
ssh codefreshrunner@metcarob.com -p ${SSH_PORT} -i /home/robert/.ssh/id_rsa_codefresh
Connect via rdocker:
-
docker run --rm -e SSH_KEY="${SSH_KEY}" -e SPLIT_CHAR="${SPLIT_CHAR}" -e SSH_PORT="${SSH_PORT}" --entrypoint /bin/bash codefresh/remote-docker -c "rdocker codefreshrunner@metcarob.com ls /"
BAD SUBSTITUTION on a stage - did you copy variables from a different project? different projects need different variables. Check all variables for this stage are setup
RJM Article Type
Work Notes