测试acl

环境:存储ip为172.19.61.178,linux客户端ip为172.19.61.105

存储端

在/share/nas中建立文件 123.txt,  echo "test" >123.txt
查看属性getfacl 123.txt
root:/share/nas# getfacl  123.txt
# file: 123.txt
# owner: root
# group: root
user::rw-
group::r--
other::r--      //其他用户只能读

linux客户端

mount -t nfs 172.19.61.178:/share/nas    /mnt
[root@chen mnt]# ls
123.txt
在linux中,建立一个用户user0,以user0来登录,则user0是不写数据到文件123.txt中
[user0@chen mnt]$ echo  "user0"  >>123.txt
bash: 123.txt: 权限不够
[user0@chen mnt]$ cat 123.txt
test

在存储端设置文件属性
root:/share/nas# setfacl  -m other:rwx   123.txt
root:/share/nas# getfacl  123.txt
# file: 123.txt
# owner: root
# group: root
user::rw-
group::r--
other::rwx
在linux客户端,[user0@chen mnt]$ echo  "user0"  >>123.txt,
这样权限设置范围太广了,对user0单独设置权限
在存储端 建立用户user0(和linux客户端user0的id号相同)
设置对user0用户的权限
setfacl   -m  user:user0:rwx  123.txt

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值