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.
精彩评论