免费注册 查看新帖 |

Chinaunix

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

请教: -rwsr-xr-x [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-12-23 14:32 |只看该作者 |倒序浏览
请教下, -rwsr-xr-x 这个r是读,w是写,x是执行 那么其中的s是代表什么呀?

论坛徽章:
0
2 [报告]
发表于 2010-12-23 14:33 |只看该作者
SUID

论坛徽章:
0
3 [报告]
发表于 2010-12-23 14:48 |只看该作者
* SUID

          o What is SUID?

            SUID stands for set user id. When a SUID file executed, the process which runs it is granted access to system resources based on the user who owns the file and not the user who created the process. When a file is SUID root it allows a program/script to perform functions that regular users are not allowed to do themselves. Many buffer overflow exploits are the result of SUID programs.
                + File permissions for SUID enabled files: -rwsr-xr-x

                + Examples of SUID root programs:
                      # logging in
                      # changing passwords
                      # low level networking routines
                      # control of graphical display functions
                      # su

                + Thomas Akin's Seven Rules for Safe SUID Programming
                     1. Do not use SUID shell scripts.
                     2. Never use SUID C-shell scripts.
                     3. Always manually set your internal field separator (IFS).
                     4. Always manually set your PATH and use absolute path names.
                     5. Understand how programs you call work, and how they handle arguments.
                     6. Do not use temporary files. If you must, don't put them in a publicly writeable area.
                     7. Distrust and check all user input and eliminate dangers such as meta-characters.

# SGID

    * What is SGID?

      SGID stands for set group id. When looking at files SGID they behave much the same as SUID files, and must be executable for it to have any effect. The SGID bit on a directory means files created in that directory will have their group set to the directory's group.
          o File permissions for SGID enabled files: -r-xr-sr-x
          o File permissions for SGID enabled directories: dr-xr-sr-x

          o Examples of SGID root programs:
                + write - write to another user (tty group)
                + slocate - linux program to find programs (slocate group)

          o NOTE: Better to make a program SGID than SUID since fewer rights are granted by group membership opposed to user.

论坛徽章:
0
4 [报告]
发表于 2010-12-23 14:50 |只看该作者
好 谢谢

论坛徽章:
0
5 [报告]
发表于 2010-12-23 23:26 |只看该作者
本帖最后由 linyunxian 于 2010-12-23 23:28 编辑
请教下, -rwsr-xr-x 这个r是读,w是写,x是执行 那么其中的s是代表什么呀?
chinaorcl 发表于 2010-12-23 14:32

    Stick 位,也被译作”粘滞位“。用来防止对拥有该目录写权限的其它用户删除你的文件用的。
比如,在公共的FTP服务器上,设置这个位用来防止它人删除你的文件。只有你自己拥有删除它的权限。

论坛徽章:
0
6 [报告]
发表于 2010-12-24 11:53 |只看该作者

论坛徽章:
2
2015年迎新春徽章
日期:2015-03-03 17:33:52数据库技术版块每日发帖之星
日期:2015-09-21 06:20:00
7 [报告]
发表于 2010-12-24 19:59 |只看该作者
suid,用chmod u+s设置。不是sticky位!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP