linux的特殊权限 权限umask默认值为00220022Special bitugo默认权限目录的默认权限是 777 - umask 755文件的默认权限是目录的默认权限去掉执行权限x 1755 - 111 644非特权用户默认的 umask 00220022且在/etc/bashrc中定义~ 目录权限将为 777 - 022 755rwxr-xr-x~ 文件权限将为 777 - 022 - 111 644rw-r–r–root的默认umask 0220022SUIDCommand run with permissions of the owner of the command, not executor of the command.在u位rwx描述sx SUID文件原来有执行权限S- SUID文件原来没有执行权限SGIDCommand runs with group affiliation of the group of the command.Files created in directories with the SGID bit set have group affiliations of the group of the directory.应用于一个目录任何人在该目录里创建的文件及目录会自动属于该目录的组。在g位rwx描述sx SGID文件组成员拥有执行权限S- SGID文件组成员不拥有执行权限Sticky-bitFiles in directories with the sticky-bit set can only be removed by the owner and root, regardless of the write permissions of the directory.在o位rwx描述tx Sticky-bit文件原来有执行权限T- Sticky-bit文件原来没有执行权限特殊权限的总结special permissionsexecutabledirectorySUIDCommand run with permissions of the owner of the command, not executor of the command. Such as: ping.N/ASGIDCommand runs with group affiliation of the group of the command.File created in directories with the SGID bit set have group affiliations of the group of the directory.Sticky-bitN/AFiles in directories with the sticky bit set can only be removed or modified by the owner and root, regardless of the write permission. Such as: /tmp. Often both the Sticky bit and the SGID permission will be set on a project directory.相关命令chmod us exefile chmod 4755 exefile ls -ld /apath chmod gs /apath chmod 2771 /apath ls -ld /apath chmod ot /apath chmod 1777 /apath ls -ld /apath其他SUID只能应用于可执行文件。SGID可应用于可执行文件也可应用于目录。Sticky-bit只能应用于目录。SUID和SGID可同时出现special bits 6。当同时出现时SUID的优先级高于SGID。SUID和Sticky-bit不可能同时出现special bits ≠ 5。ls -l的回显数字[userbee-a admin]$ ll total 36 drwxrwxr-x. 2 user user 59 Jun 20 07:53 bak -rw-rw-r--. 1 user user 644 Jun 16 22:38 get_sys_info.py drwxrwxr-x. 5 user user 41 Jun 16 22:38 __pycache__ -rw-r--r--. 1 user user 3736 Jun 18 13:13 repond.xml -rw-rw-r--. 1 user user 407 Jun 19 22:38 test1.csv -rw-rw-r--. 1 user user 162 Jun 19 21:31 test1.txt -rw-rw-r--. 1 user user 407 Jun 19 22:42 test2.csv -rw-rw-r--. 1 user user 497 Jun 20 12:50 test3.txt -rw-rw-r--. 1 user user 429 Jun 20 12:43 test4.txt -rw-rw-r--. 1 user user 181 Jun 19 22:02 test.csv -rw-rw-r--. 1 user user 1161 Jun 18 13:52 test.xml 第二列的数字 2 表示只有 . 和 .. 两个子目录 5 表示除. 和 .. 两个子目录外还有3个子目录 第一列表示文件类型 - regula file d directory l symbolic link b block special file : U盘磁盘光驱等存储设备 c character special file : 键盘等I/O设备 p named pipe s socket

相关新闻

最新新闻

TI处理器PLL寄存器配置实战:从原理到代码实现

TI处理器PLL寄存器配置实战:从原理到代码实现

1. 项目概述与PLL核心价值在嵌入式系统开发,尤其是基于TI处理器(如AM335x、AM57x系列)的项目中,时钟系统的设计与调试往往是决定系统稳定性和性能上限的关键环节。我接触过不少项目,初期跑起来看似一切正常&#xff0c…

2026/7/22 16:22:57
降AIGC率是不是智商税?讲清原理看它怎么降到达标

降AIGC率是不是智商税?讲清原理看它怎么降到达标

降AIGC率是不是智商税?讲清原理看它怎么降到达标 你心里其实是带着点怀疑点进来的。看到那么多"降 AIGC 率"的工具,你第一反应不是激动,是警惕:这会不会又是收割焦虑的智商税?是不是随便换几个词、糊弄一下…

2026/7/22 16:22:57
Config.Net自定义类型解析器开发指南:扩展框架支持复杂数据类型

Config.Net自定义类型解析器开发指南:扩展框架支持复杂数据类型

Config.Net自定义类型解析器开发指南:扩展框架支持复杂数据类型 【免费下载链接】config ⚙ Config.Net - the easiest configuration framework for .NET developers. No BS. 项目地址: https://gitcode.com/gh_mirrors/config26/config Config.Net是.NET开…

2026/7/22 16:22:57
adb 保姆级安装教程

adb 保姆级安装教程

目录 一、ADB 介绍 二、Windows 系统安装 ADB 1. 下载 ADB 2. 解压文件 3. 验证 ADB 安装 4. 配置环境变量 5. 验证全局 ADB 使用 三、macOS 系统安装 ADB 1. 下载 ADB 2. 解压文件 3. 配置环境变量 4. 验证 ADB 安装 四、Linux 系统安装 ADB 1. 使用包管理器安装…

2026/7/22 16:22:57
有没有真正能降AIGC率的工具?亲测降到检测合格

有没有真正能降AIGC率的工具?亲测降到检测合格

有没有真正能降AIGC率的工具?亲测降到检测合格 你这会儿多半正对着一个刺眼的 AIGC 率发愁,然后打开搜索框敲下那句话:到底有没有真正能降 AIGC 率的工具?我懂你的犹豫。市面上号称能降 AI 的太多了,你分不清哪些是真…

2026/7/22 16:22:57
Quansloth本地AI服务器:消费级GPU部署大模型指南

Quansloth本地AI服务器:消费级GPU部署大模型指南

1. Quansloth本地AI服务器概述Quansloth是一款基于Google TurboQuant(ICLR 2026)技术构建的本地AI服务器解决方案,专为消费级GPU环境优化设计。它通过创新的KV缓存压缩技术,能够在有限的显存资源下高效运行大规模AI模型。这个项目…

2026/7/22 16:17:57

月新闻