Daily Shaarli

All links of one day in a single page.

April 28, 2018

permissions - Allow certain guests to execute certain commands - Unix & Linux Stack Exchange
Sudo and the /etc/sudoers file aren't just for granting users full root access.

You can edit the sudoers file with an existing sudo user, with the command sudo visudo

You can group the commands that you want to grant access to like below:

Cmnd_Alias SHUTDOWN_CMDS = /sbin/poweroff, /sbin/halt, /sbin/reboot
Cmnd_Alias UPDATE_COMMANDS = /usr/bin/apt-get
You can then give a specific user privileges to those commands like so:

[User's name] ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS, UPDATE_COMMANDS