This is a simple executor that allows you to execute builds on a remote machineby executing commands over SSH.
noteEnsure you meet common prerequisiteson any remote systems where GitLab Runner uses the SSH executor.Use the SSH executorTo use the SSH executor, specify executor = "ssh" in the[runners.ssh] section. For example:
[[runners]] executor = "ssh" [runners.ssh] host = "example.com" port = "22" user = "root" password = "password" identity_file = "/path/to/identity/file"You can use password or identity_file or both to authenticate against theserver. GitLab Runner doesn鈥檛 implicitly read identity_file from/home/user/.ssh/id_(rsa|dsa|ecdsa). The identity_file needs to beexplicitly specified.
The project鈥檚 source is checked out to:~/builds////.
Where:
is a shortened version of the runner鈥檚 token (first 8 letters) is a unique number, identifying the local job ID on theparticular runner in context of the project is the namespace where the project is stored on GitLab is the name of the project as it is stored on GitLabTo overwrite the ~/builds directory, specify the builds_dir options under[[runners]] section in config.toml.
If you want to upload job artifacts, install gitlab-runner on the host you areconnecting to via SSH.
Configure strict host key checkingTo enable SSH StrictHostKeyChecking, make sure the [runners.ssh.disable_strict_host_key_checking] is setto false. The current default is true.
In GitLab 15.0 and later,the default value is false, meaning host key checking is required.