AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 56800
Accepted
IVR Avenger
IVR Avenger
Asked: 2009-08-21 11:10:40 +0800 CST2009-08-21 11:10:40 +0800 CST 2009-08-21 11:10:40 +0800 CST

在 Redhat 上,“kernel.suid_dumpable = 1”是什么意思?

  • 772

我正在运行 bash 脚本来复制一些日志文件,然后在 Red Hat 机器上重新启动服务。每次执行脚本时,我都会在控制台上看到以下内容:

[root@servername ~]# sh /bin/restart_nss.sh
kernel.suid
_dumpable = 1
Stopping Service: [ OK ]
Starting Service: [ OK ]
[root@servername ~]#

在这种情况下,“kernel.suid_dumpable = 1”是什么意思?

谢谢,IVR 复仇者

bash
  • 2 2 个回答
  • 19898 Views

2 个回答

  • Voted
  1. Best Answer
    Kyle Brandt
    2009-08-21T11:53:23+08:002009-08-21T11:53:23+08:00

    一些背景:

    setuid 位:
    可执行文件上的 setuid 位使得任何用户运行的可执行文件都像由可执行文件的所有者运行一样运行。所以如果setuid设置在root拥有的程序上,不管是谁运行,都会以root权限运行。当然没那么简单,请参阅这篇 wikipedia文章,或获取 Steven 的 Programing in the Unix Env​​ironment 的副本。

    核心转储:
    核心转储是将程序的工作内存转储到文件中。请参阅此维基百科文章。

    suid_dumpable:
    这控制是否可以如上所述从 setuid 程序中转储内核。见下文。这是一个内核可调参数,您可以使用以下命令对其进行更改:

    sudo sysctl -w kernel.suid_dumpable=2
    

    您可以在源代码的文档中找到有关此可调参数的信息,如果安装了该可调参数,您可能会在如下目录中找到: /usr/src/linux-source-2.6.27/Documentation/sysctl/ 。在这种情况下,下面的引用位于该目录的 fs.txt 中。使用该uname -a命令找出您的内核版本。

    为什么重要:

    这可能是一个安全风险:
    所以这个想法是,如果有核心转储并且普通用户可以阅读它们,他们可能会发现特权信息。如果程序被很好地转储,它在内存中具有特权信息,并且用户可以读取转储,他们可能会发现该特权信息。

    参考:

    This value can be used to query and set the core dump mode for setuid
    or otherwise protected/tainted binaries. The modes are
    
    0 - (default) - traditional behaviour. Any process which has changed
       privilege levels or is execute only will not be dumped
    1 - (debug) - all processes dump core when possible. The core dump is
       owned by the current user and no security is applied. This is
       intended for system debugging situations only.
    2 - (suidsafe) - any binary which normally not be dumped is dumped
       readable by root only. This allows the end user to remove
       such a dump but not access it directly. For security reasons
       core dumps in this mode will not overwrite one another or 
       other files. This mode is appropriate when adminstrators are
       attempting to debug problems in a normal environment.
    
    • 13
  2. Travis Campbell
    2009-08-21T11:21:00+08:002009-08-21T11:21:00+08:00

    它确定您是否可以从 setuid 进程获取核心转储。

    来自原始补丁的一些信息

    +suid_dumpable:
    +
    +This value can be used to query and set the core dump mode for setuid
    +or otherwise protected/tainted binaries. The modes are
    +
    +0 - (default) - traditional behaviour. Any process which has changed
    +   privilege levels or is execute only will not be dumped
    +1 - (debug) - all processes dump core when possible. The core dump is
    +   owned by the current user and no security is applied. This is
    +   intended for system debugging situations only.
    +2 - (suidsafe) - any binary which normally not be dumped is dumped
    +   readable by root only. This allows the end user to remove
    +   such a dump but not access it directly. For security reasons
    +   core dumps in this mode will not overwrite one another or 
    +   other files. This mode is appropriate when adminstrators are
    +   attempting to debug problems in a normal environment.
    
    • 1

相关问题

  • Mac OS X:从 python 脚本中更改 $PATH

  • Bash 脚本:要求脚本以 root 身份运行(或使用 sudo)

  • crontab ifconfig 什么都不输出

  • 使用命令行工具按排序顺序计算重复项

  • 是否有 bash 等效于 ruby​​ 的“一些内容#{foo}”?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    Windows 中执行反向 DNS 查找的命令行实用程序是什么?

    • 14 个回答
  • Marko Smith

    如何检查 Windows 机器上的端口是否被阻塞?

    • 4 个回答
  • Marko Smith

    我应该打开哪个端口以允许远程桌面?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    kch 如何更改我的私钥密码? 2009-08-06 21:37:57 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve