AutomoxAutomox

Switch user in worklet

Vipin1627
December 15, 2022 at 5:13 pm UTC
#community#Worklets

Can you su to different user to run a worklet instead of root user in linux? 

 

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack

Replies (1)

ElmerP-AutomoxDecember 16, 2022
#1

Hello,

Yes, that is possible to do. For example, if you run this as your Remediation Code...

#!/bin/bash

su -c whoami <username>

...the Worklet’s output will be “<username>”.

Hope this helps.