zoukankan      html  css  js  c++  java
  • suid sgid sbit chattr lsattr find

    suid 一般用于二进制可执行文件不可用于shell脚本和目录,suid代表当用户执行此二进制文件时,暂时具有此文件所有者的权限 chmod 4xxx binfile

    sgid 一般用于目录,sgid代表当其他用户在此目录下创建文件时其所有者为创建此目录的用户但所属组为设置sgid的用户 chmod 2xxx dir

    sbit  一般用于目录,sbit代表用户在此目录创建的文件或目录只有自己和root才可以删除

    suid sgid sbit的设置可以用命令chmod 4xxx 2xxx 1xxx 设置 但取消最好用chmod u-s g-s 取消数字无法生效

    chattr +a 只能追加内容不能删除修改(root也不可以)+i不能对文件进行任何更改 若要操作只能先取消chattr -a 

    lsattr 查看文件的隐藏权限

    find 命令

    [root@ha-master test]# ll
    总用量 0
    -rw-r--r-- 1 root root 0 1月 8 18:49 0days
    -rw-r--r-- 1 root root 0 1月 7 18:48 1days
    -rw-r--r-- 1 root root 0 1月 6 18:48 2days
    -rw-r--r-- 1 root root 0 1月 5 18:48 3days
    -rw-r--r-- 1 root root 0 1月 4 18:48 4days
    -rw-r--r-- 1 root root 0 1月 3 18:48 5days
    -rw-r--r-- 1 root root 0 1月 2 18:48 6days
    -rw-r--r-- 1 root root 0 1月 1 18:48 7days

    find . -mtime +3 -type f -exec ls -l {} ;结果为

    -rw-r--r-- 1 root root 0 1月 4 18:48 4days
    -rw-r--r-- 1 root root 0 1月 3 18:48 5days
    -rw-r--r-- 1 root root 0 1月 2 18:48 6days
    -rw-r--r-- 1 root root 0 1月 1 18:48 7days

    find . -mtime -3 -type f -exec ls -l {} ;结果为

    -rw-r--r-- 1 root root 0 1月 8 18:49 0days
    -rw-r--r-- 1 root root 0 1月 7 18:48 1days
    -rw-r--r-- 1 root root 0 1月 6 18:48 2days

    find . -mtime 3 -type f -exec ls -l {} ;结果为

    -rw-r--r-- 1 root root 0 1月 5 18:48 3days

  • 相关阅读:
    js获取服务器值以及服务器获取客户端值
    兼容IE Firefox的table自动换行
    sql行转列,列转行
    JS 压缩解压工具
    ASP.NET组织结构图的画法——数据来源读取数据库
    ANGULAR7的应用和跨域问题解决
    Ajax的使用之ScriptManager
    【.NET序列化和反序列化】基本篇
    Web Service的安全访问【SoapHeader身份认证】
    【C#3.0本质论 第一章】C#和.NET Framework概览
  • 原文地址:https://www.cnblogs.com/howhy/p/6259844.html
Copyright © 2011-2022 走看看