What is the general syntax for a sudoers entry?

The general syntax for a sudoers entry in the /etc/sudoers file is as follows:

user_or_group host=(run_as_user:run_as_group) NOPASSWD: commands

Where:

  • user_or_group: The user or group this rule applies to.
  • host: The hostname where this rule applies (usually ALL).
  • run_as_user: The user that commands will be executed as (usually ALL, meaning root).
  • run_as_group: The group that commands will be executed as (can be omitted).
  • NOPASSWD: Optional tag that allows commands to be run without entering a password.
  • commands: The specific commands that can be executed with sudo.

0 Comments

no data
Be the first to share your comment!