Run command as another 🐧 Linux user

Run command as another 🐧 Linux user

To run a command as another user on Linux, use:

sudo -u USERNAME COMMAND 

or

su USERNAME -s /bin/bash -c COMMAND  

or

runuser -l  USERNAME -c 'COMMAND'
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.