[关闭]
@yanglt7 2018-02-01T14:33:58.000000Z 字数 1888 阅读 780

Linux笔记 10

Linux


权限与指令间的关系

1. 让使用者能进入某目录成为【可工作目录】的基本权限为:

2. 使用者在某个目录内读取一个档案的基本权限为:

3. 让使用者可以修改一个档案的基本权限为:

4.让一个使用者可以建立一个档案的基本权限为:

5. 让使用者进入某目录并执行该目录下的某个指令的基本权限为:


例1:让一个使用者 ylt 能够进行 【cp /dir1/file1 /dir2】的指令时,dir1,file1,dir2 的最小权限为?
答:执行 cp 时,ylt 要能够【读取来源档,并且写入目标档】。所以各档案/目录的最小权限为:

例2:有一个档案全名为 /home/student/www/index.html ,各相关档案/目录的权限如下:
drwxr-xr-x 23 root root 4096 Sep 22 12:09 /
drwxr-xr-x 6 root root 4096 Sep 29 02:21 /home
drwx------ 6 student student 4096 Sep 29 02:23 /home/student
drwxr-xr-x 6 student student 4096 Sep 29 02:24 /home/student/www
-rwxr--r-- 6 student student 369 Sep 29 02:27 /home/student/www/index.html
请问 ylt 这个帐号(不属于 student 群组)能否读取 index.html 这个档案?
答:目录结构是有根目录一层一层读取的, ylt 不会读取到 index.html 的内容。

重点回顾

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注