Run superuser command from perl-CGI script via apache

走远了吗. 提交于 2019-12-11 04:53:48

问题


I do have a script where I can run native OS command (non-superuser command)

#!/usr/bin/perl
print "Content-type: text/html\n\n";
system("ls -lrt");

and this works fine. System Command output is displayed on Web page..

However, I have my own binary "get_stats" (with super-user privileges) placed at /sbin directory. But web page appears blank, system command output is not displayed on the webpage.

#!/usr/bin/perl
print "Content-type: text/html\n\n";
system("get_stats");

What are the changes required to be done in apache config or /etc/sudoers??

Thanks Abhishek

来源:https://stackoverflow.com/questions/13680699/run-superuser-command-from-perl-cgi-script-via-apache

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!