Kill Switch - Sawangg/dotfiles GitHub Wiki
A kill switch is a way to quickly turn off your computer or encrypt your computer so it's protected against intruders.
Run commands without the sudo password
First we will want all of our wheel users to be able to execute the poweroff command without requiring to tap a password. We will create a file called shutdown
in sudoers.d
and open it with visudo
sudo EDITOR=vim visudo -f /etc/sudoers.d/shutdown
Add this line to allow the command reboot
and poweroff
to be run without a password if you're in the wheel group
%wheel ALL=NOPASSWD: /sbin/reboot, /sbin/poweroff
Save it and now you can test running sudo poweroff
and your computer should turnoff without a need for a password, perfect for a kill switch.