1.Linux 实现文件权限
1)普通权限
2)特殊权限 理解
3)ACL访问控制列表
4)SELlinux 文件上下文fcontext
5 ) attr权限
普通权限: r :读 , w: 写(删除) , x: 执行 数字法表示 : r: 4 w:2 x:1
创建一个目录/project查看权限:
[root@server0 /]#
[root@server0 /]# mkdir /project
[root@server0 /]# ls -l /
total 32
drwxr-xr-x. 3 root root 20 Jun 15 14:48 backup
lrwxrwxrwx. 1 root root 7 May 7 2014 bin -> usr/bin
dr-xr-xr-x. 4 root root 4096 Jul 11 2014 boot
drwxr-xr-x. 19 root root 3080 Jun 16 09:57 dev
drwxr-xr-x. 134 root root 8192 Jun 16 12:02 etc
drwxr-xr-x. 5 root root 44 Jun 16 12:02 home
lrwxrwxrwx. 1 root root 7 May 7 2014 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 May 7 2014 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 Mar 13 2014 media
drwxr-xr-x. 2 root root 6 Mar 13 2014 mnt
drwxr-xr-x. 3 root root 15 Jul 11 2014 opt
dr-xr-xr-x. 491 root root 0 Jun 16 2019 proc
drwxr-xr-x. 2 root root 6 Jun 16 13:48 project
dr-xr-x---. 17 root root 4096 Jun 16 09:50 root
drwxr-xr-x. 36 root root 1180 Jun 16 09:52 run
lrwxrwxrwx. 1 root root 8 May 7 2014 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Mar 13 2014 srv
dr-xr-xr-x. 13 root root 0 Jun 16 2019 sys
drwxrwxrwt. 9 root root 4096 Jun 16 13:41 tmp
drwxr-xr-x. 13 root root 4096 May 7 2014 usr
drwxr-xr-x. 23 root root 4096 Jun 16 2019 var
drwxr-xr-x. 2 root root 6 Jun 15 14:25 website
[root@server0 /]#
d rwx r-x r-x . 2 root root 6 Jun 16 13:48 project
类型 owner group other 无acl 硬链接数 所有者 所属组(主组) 大小(字节) 修改时间 文件名
d:目录
l:链接
c:字符
b:块设备
一:普通文件
文件格式:
[root@server0 tmp]# file student-file2
student-file2: empty
[root@server0 tmp]# echo "hello" >> student-file2
[root@server0 tmp]# file student-file2
student-file2: ASCII text
[root@server0 tmp]# file test.sh
test.sh: Bourne-Again shell script, ASCII text executable
[root@server0 tmp]#
[root