When spinning up an AWS or other cloud vendor instance, and using cloud-init to configure the host, what user do bash scripts that get called run as?
Building an instance with the following config:
#cloud-config
write_files:
- path: /root/test.sh
content: |
#!/bin/bash
set -x
set -e
whoami
runcmd:
- bash /root/test.sh
I got an output of:
+ whoami
root
Ubuntu cloud-config runs as root.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With