免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2122 | 回复: 7
打印 上一主题 下一主题

如何让普通用户能够执行 /etc/init.d/httpd stop (start)? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-11-25 10:09 |只看该作者 |倒序浏览
如何让普通用户能够执行 /etc/init.d/httpd stop (start)?
同理/etc/init.d/tomcat stop (start)?

论坛徽章:
0
2 [报告]
发表于 2004-11-25 10:25 |只看该作者

如何让普通用户能够执行 /etc/init.d/httpd stop (start)?

在需要执行的文件上加上suid

论坛徽章:
0
3 [报告]
发表于 2004-11-25 10:30 |只看该作者

如何让普通用户能够执行 /etc/init.d/httpd stop (start)?

楼上仁兄,可以说的具体些吗?不太明白

论坛徽章:
0
4 [报告]
发表于 2004-11-25 10:34 |只看该作者

如何让普通用户能够执行 /etc/init.d/httpd stop (start)?

chown root.nobody yourdaemon
chmod 4755 yourdaemon

论坛徽章:
0
5 [报告]
发表于 2004-11-25 11:05 |只看该作者

如何让普通用户能够执行 /etc/init.d/httpd stop (start)?

[root@test1 init.d]# chown root.chaixf httpd
[root@test1 init.d]# chmod 4755 httpd

[chaixf@test1 chaixf]$ /etc/init.d/httpd stop
Shutting down httpd server... httpd (pid 3191?) not running
[chaixf@test1 chaixf]$ /etc/init.d/httpd start
Start httpd server... (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

[chaixf@test1 chaixf]$

有问题呀,帮忙看看?
你那里的nobody是什么?

论坛徽章:
0
6 [报告]
发表于 2004-11-25 11:17 |只看该作者

如何让普通用户能够执行 /etc/init.d/httpd stop (start)?

google: setuid
权限不够当然无法bind 1024以下的端口

nobody是httpd的group

论坛徽章:
0
7 [报告]
发表于 2004-11-25 11:26 |只看该作者

如何让普通用户能够执行 /etc/init.d/httpd stop (start)?

例如你apache安装在/usr/local/下,你打算用liusn这个用户来启动apache,简单来说两步
1.修改/usr/local/apache/conf/httpd.conf将监听端口修改为 >; 1025;
2.chown -R liusn:liusn /usr/local/apache/logs

论坛徽章:
0
8 [报告]
发表于 2004-11-25 13:34 |只看该作者

如何让普通用户能够执行 /etc/init.d/httpd stop (start)?

修改/usr/local/apache/conf/httpd.conf将监听端口修改为 >; 1025;
难道需要 http://www.mydomain:1025  ,不成吧?
那位有完整的解决方案提供?非常感谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP