salt.executors.sudo module

Sudo executor module

@author: Dmitry Kuzmenko <>

class salt.executors.sudo.SudoExecutor(opts, data, func, args, kwargs)

Allow for the calling of execution modules via sudo.

This module is invoked by the minion if the sudo_user minion config is present.

Example minion config:

sudo_user: saltdev

Once this setting is made, any execution module call done by the minion will be run under sudo -u <sudo_user> salt-call. For example, with the above minion config,

salt sudo_minion 'cat /etc/sudoers'

is equivalent to

sudo -u saltdev salt-call 'cat /etc/sudoers'

being run on sudo_minion.


Wrap a shell execution out to salt call with sudo



sudo_user: saltdev
salt '*'  # is run as saltdev user