简体   繁体   English

NGINX和cron-拒绝运行脚本的权限

[英]NGINX and cron - Permission denied to run script

The scripts that help maintain my website (Debian + NGINX) are owned by "www-data". 帮助维护我的网站(Debian + NGINX)的脚本由“ www-data”拥有。

The user that runs the cron jobs is "admin" (or root?) 运行cron作业的用户是“ admin”(或root?)。

I am logged in as admin and I cannot execute the script owned by www-data although the "admin" is a member of "www-data". 我以admin身份登录,尽管“ admin”是“ www-data”的成员,但我无法执行www-data拥有的脚本。 (permission denied). (没有权限)。

How can I allow my cron job to execute the script owned by www-data? 如何允许我的cron作业执行www-data拥有的脚本?

Got it. 得到它了。 I simply: 我只是:

sudo crontab -e -u www-data

and made the cron job run as www-data. 并使cron作业作为www-data运行。 Now it seems the cron job is running my script without access problems. 现在看来,cron作业正在运行我的脚本而没有访问问题。

您应该将权限设置为0775。这是最好的方法。

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

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