简体   繁体   中英

How to config Apache & php run as superuser

我尝试为我的项目配置apache和php,以创建基于Web的文件配置管理以在bsd unix中打开vpn,但是我无法以超级用户身份运行来启动或停止服务

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM