标签: php linux centos shell-exec
我可以使用php中的shell_exec运行需要root权限的x服务器等特定命令/程序。我只想从php shell_exec()运行x服务器程序。 注意:php在suphp下运行,OS是centos。
答案 0 :(得分:1)
在Unix文件上查看SUID和SGID
SUID stands for Set User ID. This means that if the SUID bit is set for any application then your user ID would be set as that of the owner of application/file rather than the current user, while running that application. That means in case I have an application whose owner is ' root ' and it has its SUID bit set, then when I run this application as a normal user, that application would still run as root. Since the SUID bit tells Linux that the the User ID root is set for this application and whenever this application executes it must execute as if root was executing it (since root owns this file).