sgid继承s权限问题

回复 收藏
[root@localhost ~]# mkdir 222
[root@localhost ~]# chmod g+s 222
[root@localhost ~]# cd 222
[root@localhost 222]# mkdir dir
[root@localhost 222]# touch file
[root@localhost 222]# ls -l
total 4
drwxr-sr-x. 2 root root 4096 Jul 20 19:23 dir
-rw-r--r--. 1 root root    0 Jul 20 19:23 file

file为什么不能继承S权限 ?

[root@localhost 222]# su - aming
[aming@localhost ~]$ cd /tmp/222
[aming@localhost 222]$ ls
dir  dir2  file  file2
[aming@localhost 222]$ ls -ld
drwxr-sr-x. 4 root root 4096 Jul 20 19:51 .
[aming@localhost 222]$ touch file3
touch: cannot touch `file3': Permission denied

为什么不能touch file?
2016-07-20 12:09 举报
已邀请:
0

jl2770761

赞同来自:

1、文件不能继承,要重新chmod -R g+s 222
2、222文件没有w权限,只有r-s
0

winterysea

赞同来自:

222是在/root还是/tmp啊,看起来奇奇怪怪的
0

jl2770761

赞同来自:

winterysea 发表于 2016-7-20 13:07
222是在/root还是/tmp啊,看起来奇奇怪怪的

好明显/root

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: