Re: Run script as root without sudo

From: Matt Garber <>
Date: Thu, 19 Aug 2021 06:41:39 UTC
> That would require root to put the file there and then to reboot the
> machine.
> Ari

As these are EC2 instances, you should be able to use user-data provided to
the instance’s configinit (like cloud-init) with firstboot_pkgs_list=“sudo”
similar to Colin’s example here[1], and then run your script(s) using sudo
like you originally expected to.