I am trying to run my github runner as root for self hosted linux servers. Can anyone point me to easy solution that I can implement quickly in following code:
name: Test
on: push
jobs:
Test1:
runs-on: selfhosted-linux # This should run on this self hosted runner only
steps:
- uses: actions/checkout@v2
At this point I cannot ssh into the selfhoste linux but can access it only via code in the workflow folder and I would like to run the checkout as root rather then non root user.
You need to set the environment variable RUNNER_ALLOW_RUNASROOT before you run config.sh to set up the runner. e.g.
RUNNER_ALLOW_RUNASROOT=1 ./config.sh --token asdlkjfasdlkj
You can easily install the service as root after you configure your runner. e.g
sudo ./svc.sh install root
if you have an existing runner then:
# uninstall existing service
sudo ./svc.sh uninstall
#then re-install as root user
sudo ./svc.sh install root
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With