gitlab_version: 14.1.1-ee
I copied ssh-id to targuet host with the user "user".
When I create a pipeline with "shell" runner I have a problems to comunicate to other hosts by ssh.
I created a simple task with "id" command, this return "root".
How to launch gitlab pipelines with "user" user.
Thank's.
I found how to connect to linux target host with "other user" than "runner user".
Procedure:
sshpass
on gitlab server host.Project_name/settings/"CI/CD"/Variable
, create a pass_var with password
string on key value.pipeline/editor
in script line of .gitlab-ci.yml:script:
- sshpass -p $pass_var ssh user@host_ip "hostname"