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?
Asked
Active
Viewed 23 times
0
-
How did it go? Still unclear what user it is? – Marcin Nov 05 '21 at 04:02
1 Answers
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