• 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

  • 相关阅读:
    Spring3.2新注解@ControllerAdvice
    Spring读取加密属性文件处理--待整理
    SpringMVC之三:配置Spring MVC Controller
    深入理解DIP、IoC、DI以及IoC容器
    缓存与数据库一致性之三:缓存穿透、缓存雪崩、key重建方案
    Spring容器初始化过程
    Spring框架中的@Import、@ImportResource注解
    @SpringBootApplication注解分析
    Spring bean加载之1:BeanFactory和FactoryBean
    内存使用情况
  • 原文地址:https://www.cnblogs.com/howhy/p/6259844.html
Copyright © 2020-2023  润新知