[Nut-upsuser] Request For Additional Status Confirmation

Roger Price roger at rogerprice.org
Sun Mar 7 16:40:09 GMT 2021


On Sun, 7 Mar 2021, Jon Kinne via Nut-upsuser wrote:

>             # Have the system pause while all the mail elements load,
>               sleep 60
>             # and then run the script:
>               sudo /usr/local/bin/reboot_notify
>
>       Do you need to get root involved?  If a hacker can substitute his 
> reboot_notify for yours, he gets full control.

> Being such a beginner, I didn't realize I was creating a problem with root...I 
> took your advice and removed "sudo"...is that enough, or is there something 
> else I should do for security?

Hello Jon, Any script in rc.local is probably called by root, so it's best to 
follow the example of NUT itself and drop to a non-privileged with something 
like

  sudo -u nut /usr/local/bin/reboot_notify

This list is relaxed about top posting versus bottom posting, but as you venture 
futher into the Linux world, you will meet lists which expect bottom posting, so 
it's helpful to get into the habit.

Roger


More information about the Nut-upsuser mailing list