Hello all,
I’m just following this guide: Using SSH keys with GitLab CI/CD | GitLab.
In the 5th step, says: “…add the public key from the one you created in the first step to the services”. What’s the meaning?
Hello all,
I’m just following this guide: Using SSH keys with GitLab CI/CD | GitLab.
In the 5th step, says: “…add the public key from the one you created in the first step to the services”. What’s the meaning?
It was misunderstood.
First. Go to the runner server and create the new key (gitlab-runner user.)
Second. Copy the contain of /home/github-runner/.ssh/id_rsa.pub
into the environment variable that could be read after your container to ssh-add
part:
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
Third. Use ssh-copy-id
or copy the /home/github-runner/.ssh/id_rsa.pub
into the destination server you want to deploy, for example: /home/yukey/.ssh/authorized_keys
Four. Check you can connect to the destination server using gitlab-server.
Five. Perform deploy.