[student@clone /home]$ll
...
drwxr-xr-x 11 student student 4096 Oct 18 14:19 student
...
[student@clone ~]$ls -l lake
-r-xrwxr-x 1 student student 2 Oct 18 14:31 lake
请问student能写lake文件吗?
[student@clone ~]$echo "try !!!!!!" >lake
echo "try ls -l lakels -l lakels -l lake" >lake
bash: lake: Permission denied
答案是否定的,"NO"
原因:文件的宿主如果没有写文件的权限,则社宿主不能采用组权限,
---------------------------------------
新建一用户richard,组为student
[student@clone /home]$ll
...
drwxr-xr-x 11 student student 4096 Oct 18 14:19 student
...
[student@clone ~]$ls -l lake
-r-xrwxr-x 1 student student 2 Oct 18 14:31 lake
[richard@clone student]$ ls -l lake
-r-xrwxr-x 1 student student 2 Oct 18 14:31 lake
请问此时用户richard能写lake文件吗
[richard@clone student]$ echo i >lake
[richard@clone student]$
答案是肯定的,"YES"
原因:虽然用户没有文件写权限,但他是组成员,可以用组权限写文件。
阅读(2178) | 评论(0) | 转发(0) |