Run command as another user

USER=centos
runuser -l $USER -c 'whoami'

Resource: https://devops.stackexchange.com/questions/10402/running-a-command-as-a-specific-user-on-an-ec2-using-ssm


Revision #1
Created 2023-11-10 06:14:21 UTC by Ryan
Updated 2025-02-12 01:10:55 UTC by Ryan