Re: Run script as root without sudo
- In reply to: Jonathan Chen : "Re: Run script as root without sudo"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 19 Aug 2021 06:46:56 UTC
On Wed, Aug 18, 2021 at 11:36 PM Jonathan Chen <jonc@chen.org.nz> wrote: > On Thu, 19 Aug 2021 at 18:25, Aristedes Maniatis <ari@ish.com.au> wrote: > > > > That would require root to put the file there and then to reboot the > > machine. > > In which case, wouldn't it be simpler to just start a new instance, > install your packages by hand, and then take a snapshot of the volume > and convert it to a custom AMI instead? That way all new instances > from your custom AMI will be preconfigured with the required packages. > > Cheers. > -- > Jonathan Chen <jonc@chen.org.nz> > > With the recent AWS work that I've done, I've used CloudFormation Templates to set up the EC2 instances. If you do that, you can add set up commands to the CF template that the EC23 will run as root when the system boots. That is how I've been installing software on new EC2 instances. It works pretty slick. It makes things very repeatable. Walter -- The greatest dangers to liberty lurk in insidious encroachment by men of zeal, well-meaning but without understanding. -- Justice Louis D. Brandeis