掌握目录及文件的权限设置,学会使用chmod以及chown,chgrp等命令的使用,以及更改权限的两种方法,文字设置法和数字设置法。
1、Set the attributes of the file test1 as: the file owner (u) increases the execution authority, the user in the same group as the file owner (g) increases the execution authority, and other users (o) increase the execution authority. (A screenshot is required to verify whether the setting is successful)设定文件test1的属性为:文件属主(u)增加执行权限,与文件属主同组用户(g)增加执行权限,其他用户(o)增加执行权限。(需要截图验证是否设置成功)
2、Set the attributes of the file test2 as follows: the file owner (u) increases the write permission, the user in the same group as the file owner (g) increases the write permission, and other users (o) deletes the write and execute permissions. (A screenshot is required to verify whether the setting is successful)设定文件test2的属性为:文件属主(u)增加写权限,与文件属主同组用户(g)增加写权限,其他用户(o)删除写、执行权限。(需要截图验证是否设置成功)
3、Set the attributes of the file aaa as the file owner (u) has read and write permissions, the user in the same group as the file owner (g) has read permissions, and others (o) have read permissions. (Use the text setting method and the numerical setting method to set respectively)设定文件aaa的属性为文件属主(u)拥有读、写权限,与文件属主同组用户(g)拥有读权限,其他人(o)拥有读权限。(分别用文字设定法和数字设定法进行设定)
文字设定法
数字设定法
4、 Set the attributes of the bbb file as: file owner (u) readable/writable/executable rights, users in the same group as the file owner (g) readable/executable rights, others (o) no any permissions. (Use the text setting method and the numerical setting method to set respectively)设定bbb这个文件的属性为:文件属主(u)可读/可写/可执行权,与文件属主同组用户(g)可读/可执行权,其他人(o)没有任何权限。(分别用文字设定法和数字设定法进行设定)
文字设定法
数字设定法
5、verify when umask If it is 0 003 , what are the permissions of the files and directories created in this directory? ( need to create files and directories for verification)验证当 umask 为 0003 ,在该目录下创建的文件与目录权限分别为什么?(需创建文件和目录进行验证)
6、the owner of file a to zhangsan .将文件a的所有者改成zhangsan。
7、 Change the owner and group of file b to zhangsan .将文件b的所有者和所属的组都改成zhangsan。
8、综合应用题。Teacher XXX creates two directories t eacher and student in Linux. The t eacher directory is used for teachers to publish assignments, and the student directory is used for the function of students submitting assignments. Please set the permissions of these two directories.教师XXX在Linux中创建两个目录teacher和student,teacher目录用于教师发布作业,student目录用于同学们提交作业的功能,请设置好这两个目录的权限。