一、權限修改命令:
chmod [OPTION]... MODE[,MODE]... FILE...
二、文件/目錄MODE指定方式:
1)、八進制(r=4,w=2,x=1)[root@pinfun6 tmp]# ll filename
-rwxrwxrwx 1 root root 0 Apr 15 14:37 filename
[root@pinfun6 ~]# chmod 0755 filename
[root@pinfun6 tmp]# ls -l filename
-rwxr-xr-x 1 root root 0 Apr 15 14:37 filename
2)、類別范圍(u=所有者,g=組,o=其他,a=ugo)[root@pinfun6 tmp]# ll filename
-rwxrwxrwx 1 root root 0 Apr 15 14:37 filename
[root@pinfun6 tmp]# chmod u=r-x[,o=r-x] filename
[root@pinfun6 tmp]# ll filename
-r--rwxrwx 1 root root 0 Apr 15 14:37 filename
3)、只操作某類用戶的某類權限(-/+)[root@pinfun6 tmp]# ll filename
-rwxrwxrwx 1 root root 0 Apr 15 14:37 filename
[root@pinfun6 tmp]# chmod g-w,o-w filename
[root@pinfun6 tmp]# ll filename
-rwxr-xr-x 1 root root 0 Apr 15 14:37 filename
[root@pinfun6 tmp]# chmod g+w filename
[root@pinfun6 tmp]# ll filename
-rwxrwxr-x 1 root root 0 Apr 15 14:37 filename
三、修改文件目錄的屬主、屬組
chown [OPTION]... [OWNER][:[GROUP]] FILE...
chgrp [OPTION]... GROUP FILE...
[root@pinfun6 tmp]# chown root filename #修改屬主
[root@pinfun6 tmp]# chown :root filename #修改屬組
[root@pinfun6 tmp]# chgrp root filename #修改屬組
[root@pinfun6 tmp]# chown root:root filename #修改屬主和屬組
.