简体   繁体   English

如何对Linux帐户运行Linux“ at”命令?

[英]How to run Linux 'at' command to Apache account?

If you register at a command using the shell script is running well. 如果使用shell脚本在命令中注册,则运行良好。 However, it does not run when you register at the command using php. 但是,当您使用php在命令中注册时,它不会运行。

When registering as a shell script, 注册为Shell脚本时,

61 2015-09-15 14:53 a root 61 2015-09-15 14:53根

When using php, 使用php时,

62 2015-09-15 14:53 a Apache 62 2015-09-15 14:53阿帕奇

Both properties are, however, It is registered as a user at Apache not be executed. 这两个属性都是,但是,在Apache上注册为用户的用户无法执行。

How to run Linux 'at' command to Apache account? 如何对Linux帐户运行Linux“ at”命令?

it's because of your php is running under apache user privilage you have 2 way to fix this: 这是因为您的php在apache用户权限下运行,您有2种方法可以解决此问题:

but before every thing check your script and be sure it's need to be run as root if script dont need that you just need add right permission to file like 777. 但是在检查所有脚本之前,如果脚本不需要脚本,请确保它需要以root用户身份运行,您只需要向777这样的文件添加权限即可。

if it's not work here is solution: 如果不起作用,这里是解决方案:

1- in apache config file set user and group to root, however it's completely mad and it's not right way to fix this problem because of security issue 1-在apache配置文件中将用户和组设置为root,但是这很疯狂,由于安全问题,解决此问题的方法不正确

2- add your script in sudoer file in /etc/ and run that script in another script with sudo prefix. 2-将脚本添加到/ etc /中的sudoer文件中,然后在另一个带有sudo前缀的脚本中运行该脚本。 it's not a bad as number 1 but still you can have security problem. 它不是1的不错,但仍然会遇到安全问题。 be carefull 小心点

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

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