Let's start our activity as follows:
- Run the command in a new terminal, not as root, and without any previous sudo authorization:
$ shutdown -h 10$ shutdown -c
- Now, execute the $ sudo visudo command and edit the script to include the following lines:
$ sudo visudo[sudo] password for rbrash: #Defaults env_resetDefaults mail_badpassDefaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"# Host alias specification# User alias specification# Cmnd alias specificationCmnd_Alias READ_CMDS = /sbin/halt, /sbin/shutdown# User privilege specificationroot ALL=(ALL:ALL) ALLbob ALL=(ALL:ALL) NOPASSWD: READ_CMDS# Members of the admin group may gain root privileges%admin ALL=(ALL) ALL# Allow members ...