how to do a linux reboot from php file

前端 未结 7 2071
忘掉有多难
忘掉有多难 2020-12-19 10:53

I have a user brftv on my linux system and I have www-data that runs the nginx.

from the terminal I can let my brftv user run

sudo /sbin/reboot
         


        
7条回答
  •  我在风中等你
    2020-12-19 11:34

    The only way I got this to work on my system was to "hack" it by changing chmod on /sbin/reboot like this guy did

    http://linux.byexamples.com/archives/315/how-to-shutdown-and-reboot-without-sudo-password/

    sudo chmod u+s /sbin/reboot

    I realize this might not be optimal in many cases, but this mediaPlayer is very much locked down so there is no accessing a terminal for anyone else anyways.

提交回复
热议问题