Gitlab Runner su - command with sudo rights

Hello,
I’m new to Gitlab and Gitlab runners. I configured GitlabRunner with my user which has sudo rights.
When I try to do su - command to switch to another user in gitlab runner execution no errors is occurring. When I then check whoami it is still my user and another commands are run by it. Tried to google it but found nothing since I already have got sudo rights.
Any help? Thanks in advance

1 Like

Hi,
it might be that you have do add you command in the same line/process.
Try something like:

Blockquote
sudo “your command”
or su -;“your command”
or su -||“your command”

1 Like