SCP From Gitlab-runner to host

Dear All
i have problem on gitlab-ci ! i want scp my artifact to my host , I Set Up SSH Key-Pair Authentication between runner container and my host and its work fine with command on gitlab-runner : scp -o StrictHostKeyChecking=no -r /home/gitlab-runner/builds/* user@ip:/path
but when write this command on deploy stage in gitlab-ci.yml file i faced with this error :
Permission denied, please try again.
Permission denied, please try again.
user@IP: Permission denied (publickey,password).
lost connection
ERROR: Job failed: exit status 1
why this error happen ? how fix this problem?

i find my problem!
after switch to gitlab-runner user , problem has been solved !!

2 Likes