Answers:
我已经通过为受限的管理员权限创建新的组来解决了该问题。该组的名称是LimitedAdmins
在我更新sudoers
文件后如下所示。
我添加的行是:
%LimitedAdmins ALL=NOPASSWD: /usr/bin/apt-get*, /etc/init.d/apache2 restart
这是完整的/etc/sudoers
文件:
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of directly modifying his file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
#includedir /etc/sudoers.d
%domain_name\\administrators ALL=(ALL) ALL
%LimitedAdmins ALL=NOPASSWD: /usr/bin/apt-get*, /etc/init.d/apache2 restart
如果您的系统是否为域,它可以很好地工作。
#includedir
。
我最终要做的是(类似于您要寻找的):
## PRTG monitoring
Cmnd_Alias PRTG = /bin/cat /proc/loadavg, /bin/df, /var/prtg/scripts/check_proc.sh
prtg ALL = NOPASSWD: PRTG
内: /etc/sudoers.d/666-prtg
(666,因为...好吧... prtg是您知道的基于Windows的监视工具)
#includedir
排队之后放东西吗?