常规权限:
r read 读取 4
w write 写入 2
x execute 执行 1
文件 :
r 查看文件内容(cat/more/less/head/tail/grep)
w 编辑文件内容(vim)
x shell/python脚本
目录 :
r 查看目录下的文件(ls /tmp)
w 修改目录下的文件(新建、删除、mv)
x 切换目录 (cd)
查看文件权限
查看目录权限
[root@192 ~]# ls -ld /etc/
drwxr-xr-x. 140 root root 8192 May 3 14:09 /etc/
设置文件目录权限
1)chmod
chmod {augo}{±=}{rwx} 文件名称
a all 所有
u user 属主用户权限
g group 属组
o other 其他
#chmod a+x /tmp/1.txt
#chmod u-x,o+r /tmp/2.txt
[root@192 huge]# chmod a+x 1.txt
[root@192 huge]# chmod u-x,o+r 2.txt
[root@192 home]# chmod g=rw /home/huge/3.txt
# chmod nnn 文件名称
[root@192 home]# chmod 600 /home/huge/