Reputation: 3589
i try to 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
Upvotes: 0
Views: 640
Reputation: 27323
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
Upvotes: 2
Reputation: 892
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.
Upvotes: 0