开发者

How to config Apache & php run as superuser

开发者 https://www.devze.com 2022-12-11 16:07 出处:网络
i try t开发者_开发技巧o config apache & php for my project to create web-based for file config management to open vpn in bsd unix, but i can\'t run as superuser to start or stop serviceyou can use

i try t开发者_开发技巧o config apache & php for my project to create web-based for file config management to open vpn in bsd unix, but i can't run as superuser to start or stop service


you can use a script with a setuid to do the actual command.

ie some bash script like this would do it

#!/bin/sh
/etc/init.d/openvpn $1

you shoud chmod +s yourscript.sh and use a system('yourscript.sh start') in PHP.

Note: You have to be really careful with that because it could make big security holes


Do you have sudo access on the machine? That is, can you prefix your start/stop commands with "sudo" to run them as a superuser?

If not, I think you're out of luck. But there's almost no information here to work with.

0

精彩评论

暂无评论...
验证码 换一张
取 消