In Ubuntu, how to give a user sudo but limit sudo to a few commands he really need.
- User
In Ubuntu, how to give a user sudo but limit sudo to a few commands he really need.
Assistant
In Ubuntu, you can limit sudo access to specific commands using the
/etc/sudoersfile. Here's how to do it:Method 1: Edit sudoers file directly
- Open the sudoers file safely using:
bashsudo visudo
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.