zoukankan      html  css  js  c++  java
  • ACL权限练习

    1. 在/testdir/dir里创建的新文件自动属于webs组,
      组apps的成员如:tomcat能对这些新文件有读写权限,
      组dbs的成员如:mysql只能对新文件有读权限,
      其它用户(不属于webs,apps,dbs)不能访问这个文件夹.
     mkdir /testdir/dir
     chown  .webs /testdir/dir
     setfacl -m g:apps:rw- /testdir/dir
     setfacl -m g:dbs:r-- /testdir/dir
     setfacl -m g::--- /testdir/dir
    2. 误将 /bin/chmod 文件的执行权限删除,如何恢复?
    例子: 
      root@Centos8 dir]# ll /bin/chmod

      ----------. 1 root root 76904 May 12 2019 /bin/chmod

      [root@Centos8 dir]# chmod 755 /bin/chmod

      -bash: /usr/bin/chmod: Permission denied

    解决:两种办法,一种是直接把root用户设置ACL权限,另外一种是将root组设置ACL权限。

     [root@Centos8 dir]# setfacl -m u:root:rwx /bin/chmod

     [root@Centos8 dir]# chmod 755 /bin/chmod

     [root@Centos8 dir]# ll /bin/chmod

        -rwxr-xr-x+ 1 root root 76904 May 12 2019 /bin/chmod

     [root@Centos8 dir]# setfacl -b /bin/chmod

     [root@Centos8 dir]# chmod 755 /bin/chmod

     [root@Centos8 dir]# ll /bin/chmod

     -rwxr-xr-x. 1 root root 76904 May 12 2019 /bin/chmod

  • 相关阅读:
    CF997C Sky Full of Stars
    LOJ6160 二分图染色
    AT4996 [AGC034F] RNG and XOR
    AT4119 [ARC096C] Everything on It
    20200701线性代数概率期望练习
    SNOI2020 LOJ3326 字符串
    SNOI2020 LOJ3323 生成树
    SNOI2020 LOJ3324 取石子
    Gym-102576A Bags of Candies
    Gym-102576H Lighthouses
  • 原文地址:https://www.cnblogs.com/huangguangrui/p/12762140.html
Copyright © 2011-2022 走看看