0

When I execute a sh file in EC2 using AWS Sessions Manager's Run Command, does the user (root or other user I created) configured in the executed EC2 execute the sh? Also, how do I know which user executed it?

leo
  • 57
  • 1
  • 5

1 Answers1

1

It runs as root. You can simply check it by running the following command in Run Command:

whoami > /tmp/info

Then login to the instance and check /tmp/info. You can do same for working directory pwd >> /tmp/info or any parameter you want to check.

Marcin
  • 215,873
  • 14
  • 235
  • 294