有两种方法可以实现这个目标:第一种是 使用 ACL (访问控制列表) ,第二种是创建用户组来管理文件权限 -- Aaron Kili
本文导航
-使用 ACL 来为用户赋予目录的读写权限 …… 19%
-使用用户组来为用户赋予指定目录的读写权限 …… 66%
编译自: http://www.tecmint.com/give-read-write-access-to-directory-in-linux/
作者: Aaron Kili
译者: Mr-Ping
# mkdir -p /shares/project1/reports
# df -T | awk '{print $1,$2,$NF}' | grep "^/dev"
# grep -i acl /boot/config*
# tune2fs -l /dev/sda1 | grep acl
# mount -o remount,acl /
# tune2fs -o acl /dev/sda3
# getfacl /shares/project1/reports # Check the default ACL settings for the directory
# setfacl -m user:tecmint:rw /shares/project1/reports # Give rw access to user tecmint
# getfacl /shares/project1/reports # Check new ACL settings for the directory
# chgrp tecmint /shares/project1/reports
# groupadd projects
# usermod -aG projects tecmint # add user to projects
# groups tecmint # check users groups
# chgrp projects /shares/project1/reports
# chmod -R 0760 /shares/projects/reports
# ls -l /shares/projects/ #check new permissions
欢迎光临 51学通信论坛2017新版 (http://bbs.51xuetongxin.com/) | Powered by Discuz! X3 |