1.设定普通权限的方法
chmod 设定文件权限
- chmod 复制权限
chmod --reference=/tmp /mnt/westosdir
复制/tmp目录的权限到/mnt/westosdir上
chmod -R --reference=/tmp /mnt/westosdir
复制/tmp目录的权限到/mnt/westosdir及 目录中的子文件上( -R 代表递归操作)
- chmod 字符方式设定权限
chmod <a|u|g|o><+|-|=><r|w|x> file
用字符方式设定文件权限
示例:
chmod u-rw /mnt/westosfile1
chmod u-rw,g+x,o+wx /mnt/westosfile2
chmod a-rwx /mnt