DEV Community

Pradeep Kumar
Pradeep Kumar

Posted on

[Solved] GitLab SSH Runners - Error: open /root/.ssh/known_hosts: no such file or directory

If you getting following error:

Using SSH executor...
ERROR: Preparation failed: ssh command Connect() error: getting host key callback: open /root/.ssh/known_hosts: no such file or directory
Will be retried in 3s ...
Enter fullscreen mode Exit fullscreen mode

Follow the steps to resolve:

1) Login to gitlab instance via SSH
2) Become sudo via:

sudo su
Enter fullscreen mode Exit fullscreen mode

3) Now, you need to connect gitlab instance to the host where runner is try to connect

ssh <host-username>@<host-ip>
Enter fullscreen mode Exit fullscreen mode

<host-username> and <host-ip> should match with the gitlab runner, it will ask for password then it will ask to accept key fingerprint.

Now, try to run the job with the runner. It should be working

Oldest comments (0)