Question

Switch user in worklet

  • 15 December 2022
  • 1 reply
  • 31 views

Badge

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

 


1 reply

Userlevel 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.

Reply