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

相关新闻

最新新闻

SerenityOS 命令行选项解析指南:getopt 与 getopt_long 用法、返回值与底层实现

SerenityOS 命令行选项解析指南:getopt 与 getopt_long 用法、返回值与底层实现

SerenityOS 命令行选项解析指南:getopt 与 getopt_long 用法、返回值与底层实现 【免费下载链接】serenity The Serenity Operating System 🐞 项目地址: https://gitcode.com/GitHub_Trending/se/serenity 导读 本文以 getopt(3) 手册 为核心&a…

2026/9/29 2:52:50
轻量服务器还是ECS?大促云服务器选购与避坑实战指南

轻量服务器还是ECS?大促云服务器选购与避坑实战指南

每年大促节点,群里永远有人在问同一个问题:“38元的轻量服务器到底怎么抢?为什么我每次点进去都是已售罄?68元直购和99元的ECS我到底选哪个?”作为一个常年帮团队和自己采购云服务器的老用户,我太清楚这种纠…

2026/9/29 2:52:51
为 AI 代理的 Review 动作编写 Cedar 审批门控策略:review-agent-governance 策略编写实战指南

为 AI 代理的 Review 动作编写 Cedar 审批门控策略:review-agent-governance 策略编写实战指南

为 AI 代理的 Review 动作编写 Cedar 审批门控策略:review-agent-governance 策略编写实战指南 【免费下载链接】agents Multi-harness agentic plugin marketplace for Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, and Google Antigravity 项目地址:…

2026/9/29 1:29:30
PaddleOCR 手写数学公式识别算法 CAN 实战指南:Counting-Aware Network 训练、评估与推理部署

PaddleOCR 手写数学公式识别算法 CAN 实战指南:Counting-Aware Network 训练、评估与推理部署

PaddleOCR 手写数学公式识别算法 CAN 实战指南:Counting-Aware Network 训练、评估与推理部署 【免费下载链接】PaddleOCR Turn any PDF or image document into structured data for your AI. A powerful, lightweight OCR toolkit that bridges the gap between i…

2026/9/29 1:39:24
Spring源码解析:构造器注入的类型转换与候选匹配机制

Spring源码解析:构造器注入的类型转换与候选匹配机制

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/9/29 22:57:57
openai-agents-python 多模型接入指南:深入解析 AnyLLMModel 适配层与 any-llm 路由

openai-agents-python 多模型接入指南:深入解析 AnyLLMModel 适配层与 any-llm 路由

openai-agents-python 多模型接入指南:深入解析 AnyLLMModel 适配层与 any-llm 路由 【免费下载链接】openai-agents-python A lightweight, powerful framework for multi-agent workflows 项目地址: https://gitcode.com/GitHub_Trending/op/openai-agents-pyth…

2026/9/29 2:52:53

日新闻

周新闻