To add a Sudo rule
- Start Group Policy Editor.
- Select Unix Settings | Authentication Services | Client Configuration in the scope view.
- Double-click Sudo.
The Sudo Properties dialog opens.
- Click the Add or Edit button.
The Sudo Rule dialog opens.
- In the Unix Command group box, select All Commands if you want this rule to apply to all commands. Otherwise, specify the full Unix path to the command. For security reasons, relative paths are not allowed. To deny access to the command, click the Disallow the specified command option and the user will be unable to execute the command with sudo.
- In the Run as User field, enter the Unix name of a user. The command will run in the security context of the specified user. The default user is root. Select the Password required option if you want sudo to prompt the user for his password when the command is executed.
- In the Apply to Users and Groups box, specify the users and groups to which the rule will apply.
If you want the rule to apply to all users, select the Allow all users to run this command option.
Otherwise, enter a user or group name and select either User or Group to indicate whether the name is for a user or a group and click Insert. You can specify groups with Text Replacement Macros in the name. For example sudo-group-%%HOSTNAME%%. By defining a text replacement macro for %%HOSTNAME%% you can create one policy which will dynamically adjust the name on each machine when policy is applied.
Or, click Browse to find an Active Directory user or group. The standard Select Users or Groups dialog opens. You can search for multiple objects by separating each name with a semicolon.
- Click OK to return to the Sudo Properties dialog.
- You can optionally specify the Path to visudo. Group Policy uses visudo to validate that the sudoers file can be parsed correctly by sudo. If visudo cannot validate the sudoers file, the policy is not applied. If you do not specify the path to visudo, Group Policy attempts to locate it automatically by searching in common locations. If it can not locate visudo, it can not apply the policy.
- Click OK to save this new configuration for the sudoers file.