ssh-agent icon indicating copy to clipboard operation
ssh-agent copied to clipboard

Documentation about how to set up self-hosted runners

Open LastStarDust opened this issue 1 year ago • 4 comments

First of all thank you for developing such a useful action.

It works flawlessly for github runners but I am having trouble for a non ephemeral self-hosted runner.

By reading some issues, I came to understand that self-hosted runners need some manual configuration, like setting up the known hosts file and such.

While I could figure it out on my own with some effort, it would be much appreciated if the README file explained the steps needed to set up self-hosted runners.

LastStarDust avatar Mar 06 '24 21:03 LastStarDust

Seconded, also experiencing issues with non-ephemeral self-hosted runners. @LastStarDust what manual configuration did you need to perform if you're able to share?

chufnagel avatar Mar 15 '24 15:03 chufnagel

I had to reset the SSH and git configuration of the self-hosted runner and then I had to manually copy the private SSH keys with appropriate names. Moreover I had to modify the following snippet with the correct user name of the runner.

RUN sed 's|/home/runner|/root|g' -i.bak /root/.ssh/config

LastStarDust avatar Mar 18 '24 02:03 LastStarDust

@LastStarDust Do you have an example of what you needed to do? As I have come across the same issue

daleh-daemon avatar May 30 '24 14:05 daleh-daemon

My memory is hazy but here is what I remember:

In the self-hosted runner (assuming github as user name):

  1. rm /home/github/.ssh/*
  2. vi /home/github/.ssh/authorized_keys
  3. Add your key and save
  4. ssh-keyscan github.com >> ~/.ssh/known_hosts

If you use docker inside the runner, you might need to add the following command to the Dockerfile:

RUN sed "s|/home/github|/home/${USERNAME}|g" -i.bak .ssh/config

where USERNAME is the name of the user inside the docker image. But the paths might be different depending on how you setup the image environment.

LastStarDust avatar Jun 11 '24 06:06 LastStarDust

Friendly reminder

LastStarDust avatar Sep 09 '24 03:09 LastStarDust

I am giving up on this for lack of interest (both on my side and maintainers' side).

LastStarDust avatar Sep 23 '24 11:09 LastStarDust