Linux中,强制位和冒险位的作用_第1页
Linux中,强制位和冒险位的作用_第2页
Linux中,强制位和冒险位的作用_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1在Linux中,强制位和冒险位的作用是什么?强制位有SGID , SUIDSGID乍用:默认情况下,用户建立的文件夹属于用户当前所在的组, 但是设置了 SGID后,表示在此目录中,任何人建立的文 件,都会属于目录所属的组。SGID只能对目录设置SUID作用:当一个文件设置了 SUID那么所有用户执行这个文件的 时候,那是以这个用户的所有者的权限来执行。冒险位(sticky)作用:目录上设置了冒险位,则表示在此目录中,只有文件的拥有者,目录的拥有者与系统管理员可以删除文件。其他用户则不能设置SGID厂-# cd test roDtlocalhost test# 11 total. 16drwx

2、r-xr-x 2 root root drwxrwxrwx 2 root root (rootlocathost test roatlocalhost test# total 164096 Oct 23 09:08 test4996 Oct 23 00:09 chmod g+s testdrwxr-sr-x 2 root root d rwx rwx rwx 2 root root rootlocalhost test#4096 Oct 23 00:08 test4096 Oct 23 00:09设置SUIDroot(aiocalhost rootlocalhost total 16test#

3、 chmod u+s test2 test# Lldrwxr-sr-x 2 root rootd rws rwx rwx 2 root rootroottaiocathost test#4996 Oct 23 0S108 test4096 Oct 23 00:09设置冒险位roctlocalhost T# (rootQlocBltiost test J# rootlocBlhost test# -rw-r- 1 root root (root(Blocaltiost test # rootlocalhost test# -rw-r-r-T 1 root root rootlocalhost t

4、esttesttouch test311 test39 Oct 24 90:10 test3chmod o+t test3LI test39 Oct 24 06:10 test3test:rootlocalhost test# su - lauyuanbinLauyuanbinlocaltiost cd tmp-iash: cd: tmp: No such file ar directory lauyuanbinlocaLfiost -S cd /tmp (lauyuanbinXocalhost tmp专 ll -d test drwxrwxrwt 2 root root 4096 Oct 2

5、4 SQ:18 | lauyuanbinXocaliiost tmp% cd /tmp/test lauyuant)inloc:mlliost test$ ll total 4-rw-r-r- 1 root root 0 Oct 24 GO:18 file lauyuanbinlocal.!iost testrm /tmp/test/flierm: remove write-protectEd regular empty file /tmp/test/file,? lauyuanbinlocalhost test s |2在Linux中,umask的作用是什么?umask功能说明:指定在建立文

6、件或目录时预设的权限掩码。建立时的mkdir test is -1默认权限。rootlocalhost test# rootlocalhost test# total 6drwxr-xr-x 2 root root4996 Oct 2369:OS testrootlocalhost test# umask OG rootlocalhost testl# Is -I total 8drwxr-xr-x 2 root root4096 Oct 2369:08 testroot01ocalhost test rootLocaLhost test* total 16mkdir test? is -Ld

7、rwxr-xr-x 2 root root4996 Oct 2309:G8 test09:09drwxrwxrwx 2 root root 4096 Oct 23rootlocalhost test# |参 数:-S 以文字的方式来表示权限掩码。 文件:用八进制基数 666,即无 x 位(可执行位) rw- rw- rw-. 执行位需由用户自 行加入例一:设要生成的文件以 rw- r- r-这样的权限字出现,即真实权限用八进制表 示为 644,则被 666基数减得 022, 022即掩码。使用 umask 022。注: 033效果与 022 一样,假设使用 033掩码进行设置,则真实权限应为 633即 rw- r-x r-x ,但前提规定文件不生成 x 位,所以文件的权限最终将以 rw-r-r-

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论