Linux Run Command as another user

To run command as another user on Linux, you can use

su USER_NAME_HERE -s /bin/bash -c COMMAND_HERE

Or

sudo -u USER_NAME_HERE COMMAND_HERE

Or

runuser -l  USER_NAME_HERE -c 'COMMAND_HERE'

See sudo

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *