To combine the two visudo lines for benjamin_loison into a single entry, you can merge the commands after the NOPASSWD: tag. Here’s how you can do it:
benjamin_loison ALL=(ALL:ALL) NOPASSWD: program a b, program c
Explanation:
- The backslash (
\) is used for line continuation in the sudoers file, but it’s not necessary if you combine everything into one line.
- The comma (
,) separates the commands or command groups that benjamin_loison is allowed to run without a password.
Result:
The combined line allows benjamin_loison to run program a b and program c without a password prompt.
Note: Always use visudo to edit the sudoers file to avoid syntax errors. If you want to keep the line breaks for readability, you can use the backslash as in your original example, but it’s not required for functionality. For example:
benjamin_loison ALL=(ALL:ALL) NOPASSWD: \
program a b, program c