how can I run a perl script which needs root?
问题 I need to execute a perl script located in /root/scripts/ from php using ssh from another computer or from the same computer. The thing is that I just don't know how to make php log into roots account to excecute only that file. As user$ I can't access /root/scripts/, so I can't call it using excec or system. I have tried using ssh to log into sudo su, and when I give my password it hangs. I leave the code here: <?php include('Net/SSH2.php'); $ssh = new Net_SSH2('IP'); if (!$ssh->login('user'