SSH for gitlab CI

July 25, 2019 1.1k views


I’m trying to setup gitlab CI.
I need to understand how to install ssh to be able to copy files to the webserver.

Im reading these two docs:

I would like to make this yml work for me:

I have created the ssh key on the webserver and on the gitlab server I added the public key.
And then I set varaible SSHPRIVATEKEY as the private key.

When I run pipeline I get: Permission denied (publickey,password).

Do I need to do anyting on the gitlab runner macchine?


1 Answer

Hello, Br

You need to copy the public key from the gitlab runner macchine ( in the authorizedkeys file in the server where you want to connect.

Basically the public key - needs to be added in the authorizedkeys file on the server where you will copy the files.

If you’re having any issues you can also paste the content of the /etc/ssh/ssh_config file as well.

Let me know if you have any questions.


Have another answer? Share your knowledge.