ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

linux系统编程之特权(Capabilities)程序、进程

2021-10-04 16:33:14  阅读:253  来源: 互联网

标签:linux processes CAP permission 编程 capabilities Capabilities Linux checks


在系统编程中,经常会看到特权程序、进程一说,特权指的是一种能力。官方定义:Linux capabilities are special attributes in the Linux kernel that grant processes and binary executables specific privileges that are normally reserved for processes whose effective user ID is 0 (The root user, and only the root user, has UID 0).

跟sudo的作用是类似的。

通过man 7 capabilities可以查看所有的各种能力。

CAPABILITIES(7)                                                                  Linux Programmer's Manual                                                                 CAPABILITIES(7)

NAME
       capabilities - overview of Linux capabilities

DESCRIPTION
       For  the  purpose  of  performing  permission checks, traditional UNIX implementations distinguish two categories of processes: privileged processes (whose effective user ID is 0,
       referred to as superuser or root), and unprivileged processes (whose effective UID is nonzero).  Privileged processes bypass all kernel permission checks, while unprivileged  pro-
       cesses are subject to full permission checking based on the process's credentials (usually: effective UID, effective GID, and supplementary group list).

       Starting  with  kernel 2.2, Linux divides the privileges traditionally associated with superuser into distinct units, known as capabilities, which can be independently enabled and
       disabled.  Capabilities are a per-thread attribute.

   Capabilities list
       The following list shows the capabilities implemented on Linux, and the operations or behaviors that each capability permits:

       CAP_AUDIT_CONTROL (since Linux 2.6.11)
              Enable and disable kernel auditing; change auditing filter rules; retrieve auditing status and filtering rules.

       CAP_AUDIT_WRITE (since Linux 2.6.11)
              Write records to kernel auditing log.

       CAP_BLOCK_SUSPEND (since Linux 3.5)
              Employ features that can block system suspend (epoll(7) EPOLLWAKEUP, /proc/sys/wake_lock).

       CAP_CHOWN
              Make arbitrary changes to file UIDs and GIDs (see chown(2)).

       CAP_DAC_OVERRIDE
              Bypass file read, write, and execute permission checks.  (DAC is an abbreviation of "discretionary access control".)

       CAP_DAC_READ_SEARCH
              * Bypass file read permission checks and directory read and execute permission checks;
              * Invoke open_by_handle_at(2).

       CAP_FOWNER
              * Bypass permission checks on operations that normally require the file system UID of t

https://www.vultr.com/docs/working-with-linux-capabilities 

标签:linux,processes,CAP,permission,编程,capabilities,Capabilities,Linux,checks
来源: https://www.cnblogs.com/zhjh256/p/15366627.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有