免费注册 查看新帖 |

Chinaunix

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

【转载】Solaris10如何让普通用户能够使用1024号以下的端口? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-18 17:34 |只看该作者 |倒序浏览

                                                               
     我们知道,1024以下的端口只有用root才能进行一些操作,包括要启动一些程序,比如apache
等,都需要有root的权限,但如果应用了Solaris中的least
privilege的特性,这样就可以对特定的普通用户来赋予特定权限,比如对于有客户要求可以让一个普通用户来监听1024以下端口,可以用命令:
#usermod -K defaultpriv=basic,net_privaddr test
来实现,其中test是用户名,赋予的权限为net_privaddr, 这个权限的具体含义可以参见privileges的man page.
PRIV_NET_PRIVADDR
Allow a process to bind to
a privileged port number. The privilege port numbers are 1-1023 (the
traditional UNIX privileged ports) as well as those ports marked as
"udp/tcp_extra_priv_ports" with the exception of the ports reserved for
use by NFS.
但问题是,我怎么知道就需要赋予这个权限那,那需要你先好好看看这个文章
http://www.sun.com/bigadmin/features/articles/least_privilege.html
简单来说,就是要用命令#ppriv -D -e
来检测你还需要什么权限。另外还有几篇好的文章可以做为参考
http://iforce.sun.com/protected/solaris10/adoptionkit/tech/least/tutorial.html
http://docs.sun.com/app/docs/doc/816-4557/6maosrjfe
http://developers.sun.com/solaris/articles/program_privileges.html
   另:WIKI上的解决办法(http://wiki.gceclub.sun.com.cn):
   [S10]
假设用户名为appuser
   1. vi /etc/user_attr。
   2. 增加“appuser::::defaultpriv=basic,net_privaddr”至最后一行。
   3. 重新使用appuser登录,运行应用即可。
   [S8] [S9]不支持以上的方法,使用setuid或直接用root运行应用。
               
               
               
               
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14456/showart_384628.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP