1 Answer
- Newest
- Most votes
- Most comments
0
sample code
sudo -u ec2-user whoami
I referred to the following sites
https://stackoverflow.com/questions/57443700/running-command-in-userdata-as-a-not-root-user https://zenn.dev/nnnto/articles/df29c8d03e1c45
Relevant content
- asked 2 years ago
- asked 7 years ago
