Search code examples
ubuntusudovpsgithub-actions

How to Overcome "Must not with Sudo" error in setting up Github Actions config on VPS


I am attempting to setup Github actions runner on my Ubuntu VPS and on step 3 where I have to set up the config.sh file, I get the error as : Must not run with Sudo and the process fails there. My root account is password protected though and I do not understand what is the issue here. But any what I am looking for is how to get through this problem. I am not actually deploying a serious app, this is all just for practice.


Solution

  • It's because you're running the commands as the root user. Either create a new user using sudo newuser {username} or run the command export {AGENT_ALLOW_RUNASROOT="1"} i recommend option 1 but both work just fine.