Linux系统对访问控制(ACL)权限的实现1.对分区添加一个ACL访问控制的权限和增加用户
[root@localhost ~]# mount -o remount,acl /dev/md0 /mnt/sdb
[root@localhost ~]# useradd user1
[root@localhost ~]# useradd user22.关于用户对目录的权限授权
[root@localhost ~]# setfacl -m u:user1:rwx /mnt/sdb
[root@localhost ~]# setfacl -m u:user2:rx /mnt/sdb3.测试是否生效
[root@localhost ~]# su - user1 --连接user1用户
[user1@localhost ~]$ cd/mnt/sdb
[user1@localhost sdb]$ mkdirqw --user1用户可以写入文件
[user1@localhost sdb]$ touch1.txt
[user1@localhost sdb]$ exit
logout
[root@localhost ~]# su - user2 --连接user2用户
[user2@localhost ~]$ cd/mnt/sdb
[user2@localhost sdb]$ mkdiras --不能创建目录
mkdir: cannot create directory `as": Permission denied
[user2@localhost sdb]$ touch2.txt --不能写入文件
touch: cannot touch`2.txt": Permission denied
[user2@localhost sdb]$4.查看文件是否的控制权限和取消控制权限
[user2@localhost sdb]$ getfacl 1.txt --查看文件权限
# file: 1.txt
# owner: user1
# group: user1
user::rw-
group::rw-
other::r--
[user2@localhost sdb]$ getfacl qw --查看目录权限
# file: qw
# owner: user1
# group: user1
user::rwx
group::rwx
other::r-x
[root@localhost ~]# setfacl -x u:user1 /mnt/sdb --用-x取消权限
[root@localhost ~]# getfacl /mnt/sdb --查看取消之后的权限
getfacl: Removing leading "/"from absolute path names
# file: mnt/sdb
# owner: root
# group: root
user::rwx
user:user2:r-x
group::r-x
mask::r-x
other::rwx
[root@localhost ~]#Linux实现Cisco风格ACL之空想 http://www.linuxidc.com/Linux/2013-05/84669.htmLinux ACL权限规划:getfacl,setfacl使用 http://www.linuxidc.com/Linux/2013-07/88049.htmLinux系统禁pingLinux free命令输出信息详解相关资讯 ACL权限 Linux ACL
- Red Hat Linux 7 下 ACL权限基本设 (03月17日)
- Linux命令之ACL权限 (01/07/2015 19:50:42)
- RHCE系列之权限管理----ACL(访问 (07/06/2014 14:21:46)
| - Linux软防火墙ACL匹配的优化点 (07/17/2015 09:21:24)
- Linux ACL权限设定 (01/03/2015 15:53:48)
- Linux ACL权限规划:getfacl, (07/30/2013 07:12:09)
|
本文评论 查看全部评论 (0)