23 May 2013
Execute sudo in php
It’s definitely unsecured but a quick way to do some magic.
<?php #echo password to sudo system('echo "PASS" | sudo -u root -S COMMAND'); #example system('echo "password" | sudo -u root -S systemctl restart httpd.service') ?>
JZR at 00:50