我试图只允许某个组的用户让它调用websupport访问重启2服务:mysqld和httpd
编辑:我不想给这些用户sudo访问权限
我已将这些行添加到/ etc / sudoers:
%websupport ALL = NOPASSWD:/etc/init.d/httpd
和
%websupport ALL = NOPASSWD:/etc/init.d/MysqLd
/etc/init.d/httpd restart
我得到这个结果:
rm: cannot remove ‘/var/run/httpd/httpd.pid’: Permission Denied [Failed]
rm: cannot remove ‘/var/lock/subsys/httpd’ : Permission Denied
rm: cannot remove ‘/var/run/httpd/httpd.pid’ : Permission Denied
Starting httpd: httpd: apr_sockaddr_info_get() Failed for wssapache
httpd: Could not reliably determine the server’s fully qualified domain name,using 127.0.0.1 for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available,shutting down
Unable to open logs [Failed]
试图运行时:
/etc/init.d/MysqLd restart
我得到这个结果:
cat: /var/run/MysqLd/MysqLd.pid: Permission denied
Stopping MysqLd: [Failed]
Starting MysqLd: [ OK ]