sudo使用

# 免密执行指定指令
dns   ALL= NOPASSWD: /usr/bin/systemctl restart dnsmasq
user  ALL= NOPASSWD: /usr/bin/systemctl restart php-fpm,/usr/bin/umount,/usr/bin/
user  ALL= NOPASSWD: /usr/bin/systemctl restart php-fpm
user  ALL=(ALL)       NOPASSWD: /usr/sbin/nginx -s reload
www ALL=(ALL)       NOPASSWD: /bin/sh /www/reload.sh


# 免密执行所有指令
user ALL=(ALL) NOPASSWD: ALL

posted @ 2023-02-10 13:21  AlexG  阅读(13)  评论(0编辑  收藏  举报