我有一个 www-data 用户,我允许他在 /etc/sudoers 中重新启动 PHP FPM:
www-data ALL=(ALL) NOPASSWD:/usr/sbin/service php7.4-fpm restart
/etc/sudoers 有正确的权限
ls -la /etc/sudoers
-r--r----- 1 root root 915 Jan 19 23:26 /etc/sudoers
但我仍然无法从 www-data 帐户重新启动 FPM
/usr/sbin/service php7.4-fpm restart
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'php7.4-fpm.service'.
Authenticating as: root
Password:
当我尝试输入密码时,我收到了不同的错误
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to restart php7.4-fpm.service: Access denied
有什么问题?