The example code here references Docker and IoT Edge as an example. The user/pass is Base64 encoded as part of the Bash class in this example.
By no means should you keep the admin user/pass hard-coded in the production class, this is an example piece.
The Bash
class has both RunAs(..)
and Command(..)
, and each allows you to run using sudo
. The difference is, the RunAs(...)
method does not require your app to be started with elevated privledges. Where as, Command(..)
requires you to start the app with elevated privledges in order to execute commands using sudo
.