我已经按照本主题中所述编辑了 /etc/sudoers:
...允许特定用户通过终端重新启动/关闭而无需 root 密码,但在尝试通过 GUI 中的菜单重新启动/关闭时,仍会提示用户输入密码。
还需要编辑/修改哪些内容才能实现此目的?
[root@**redacted** ~]# grep -v '^#' /etc/sudoers
Defaults !visiblepw
Defaults always_set_home
Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR
LS_COLORS"
Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL
ecouser ALL=NOPASSWD: /sbin/shutdown, /sbin/reboot, /sbin/poweroff
Defaults:ALL timestamp_timeout=5
%eco-linuxadmins ALL=(ALL) ALL
%eco-ent-temp-all-sudoer ALL=(ALL) ALL
eco-svc-nessus ALL=(ALL) ALL
%eco-it-access ALL = /bin/ping
%eco-it-access ALL = /bin/ping6
%eco-it-access ALL = /usr/bin/updatedb
%eco-it-access ALL = /bin/kill
%eco-it-access ALL = /usr/bin/killall
%eco-it-access ALL = /usr/bin/pkill
%eco-it-access ALL = /sbin/service
%eco-it-access ALL = /bin/cat
%eco-it-access ALL = /bin/zcat
%eco-it-access ALL = /bin/ls
%eco-it-access ALL = /bin/grep
%eco-it-access ALL = /usr/bin/tail
%eco-it-access ALL = NOEXEC: /bin/find
%wheel ALL=(root) NOPASSWD: /sbin/shutdown -h now
ecouser ALL=NOPASSWD: /bin/mount, /bin/umount, /sbin/mount.cifs