我试图只允许某个组的用户让它调用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
我得到这个结果:
解决方法 您的sudoers中的条目看起来不错.您需要使用sudo来运行命令,例如cat: /var/run/MysqLd/MysqLd.pID: Permission denIEd
StopPing MysqLd: [Failed]
Starting MysqLd: [ OK ]
sudo etc/init.d/httpd restart
和
sudo etc/init.d/MysqLd restart
您也可以组合sudoers中的条目
%websupport ALL=nopASSWD:/etc/init.d/MysqLd,/etc/init.d/httpd总结
以上是内存溢出为你收集整理的linux – 创建组以在CentOS中重新启动服务全部内容,希望文章能够帮你解决linux – 创建组以在CentOS中重新启动服务所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)