简体   繁体   English

CGI:以root身份执行python脚本

[英]CGI: Execute python script as root

I'm attempting to execute foo.py from mysite.com/foo.py , however the script requires access to directories that would normally require sudo -i root access first. 我正在尝试从mysite.com/foo.py执行foo.py ,但是该脚本需要访问通常通常首先需要sudo -i root访问的目录。 chmod u+s foo.py still doesn't give the script enough permission. chmod u+s foo.py仍然没有给予脚本足够的权限。 What can I do so the script has root access? 我该怎么办,脚本具有root访问权限? Thank you! 谢谢!

Have you tried chmod 777 foo.py or chmod +x foo.py ? 您是否尝试过chmod 777 foo.pychmod +x foo.py Those are generally the commands used to give file permission to run. 这些通常是用于授予文件运行权限的命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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