How Do I Run a Command as a Different User in Linux?

How Do I Run a Command as a Different User in Linux?
Contents

How do I run a command from a different user in Linux?

  1. In Linux, the su command (switch user) is used to run a command as a different user. …
  2. To display a list of commands, enter the following: su –h.
  3. To switch the logged-in user in this terminal window, enter the following: su –l [other_user]

How do I run a command in another user?

To “Run as different user” using RUNAS Command in Command Prompt

  1. Open CMD.
  2. Enter the command. runas /user:USERNAME “C:fullpathofProgram.exe” For example, if you want to start notepad from user Test run this command : …
  3. Now you should enter users password.
  4. If there will be UAC pop up press yes.

14 сент. 2019 г.

Sophia Al-Mansoor
Author

Sophia Al-Mansoor

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.