Under which user account privileges does the User Data script execute?

On Linux EC2 instances, User Data scripts run as the root user by default, while on Windows they run under the Local System account.
  • Amazon Linux / RHEL / CentOS / Ubuntu: User Data runs as root.
  • Windows Server: User Data (EC2Launch/EC2Config) runs as Local System.
This default behavior ensures the script can install packages, modify system files, and configure the instance without requiring sudo.
Veuillez vous connecter pour demander, répondre, partager, aimer et voter.