1.文件权限
755-》对应权限:rwxr-xr-x
该文件的属主用户对该文件的可读可写可执行权限;
该文件的属组用户对该文件的可读可执行权限;
其他所有用户对该文件的可读可执行权限。
660-》对应权限:rw-rw----
该文件的属主用户对该文件的可读可写权限。
644-》对应权限: rw--w--w-
该文件的属主用户对该文件的可读可写权限;
该文件的属组用户对该文件的可读权限;
其他所有用户对该文件的可读权限。
6755-》对应权限:设置SUID和SGID rwxr-xr-x
1664-》对应权限:设置stickyrw-rw--w-
2.创建修改
1)创建文件,并赋予权限611(两种方式,一种guoa,一种nnn)
[root@localhost ~]# touch chomd_txt1
[root@localhost ~]# ls -l chomd_txt1
-rw-r--r--. 1 root root 0 May 13 06:13 chomd_txt1
[root@localhost ~]# chmod go+x chmod_txt1
[root@localhost ~]# chmod go-r chmod_txt1
[root@localhost ~]# ls -l chmod_txt1
-rw---x--x. 1 root root 0 May 13 06:09 chmod_txt1
[root@localhost ~]# chmod 611 chmod_txt1
[root@localhost ~]# ls -l chmod_txt1
-rw---x--x. 1 root root 0 May 13 06:09 chmod_txt1
2)创建目录,并赋予权限755(两种方式,一种guoa,一种nnn)
[rhcsa@localhost ~]$ mkdir chmod_dir/
[rhcsa@localhost ~]$ ls -dl chmod_dir/
drwxrwxr-x. 2 rhcsa rhcsa 6 May 13 06:22 chmod_dir/
[rhcsa@localhost ~]$ chmod g-w chmod_dir/
[rhcsa@localhost ~]$ ls -dl chmod_dir/
drwxr-xr-x. 2 rhcsa rhcsa 6 May 13 06:22 chmod_dir/
[rhcsa@localhost ~]$ chmod 755 chmod_dir/
[rhcsa@localhost ~]$ ls -dl chmod_dir/
drwxr-xr-x. 2 rhcsa rhcsa 6 May 13 06:22 chmod_dir/
3)创建文件,并将文件的属主和属组修改其他用户
[rhcsa@localhost ~]$ touch chomd_txt2
[rhcsa@localhost ~]$ ls -l chomd_txt2
-rw-rw-r--. 1 rhcsa rhcsa 0 May 13 06:24 chomd_txt2
[rhcsa@localhost ~]$ chown rhcsa:rhcsa chomd_txt2
[rhcsa@localhost ~]$ ls -l chomd_txt2
-rw-rw-r--. 1 rhcsa rhcsa 0 May 13 06:24 chomd_txt2