【问题标题】:What capabilities can open /proc/pid/ns/net?哪些能力可以打开/proc/pid/ns/net?
【发布时间】:2021-06-12 09:21:29
【问题描述】:
setcap cap_net_raw,cap_net_admin,cap_sys_admin,cap_dac_override,cap_dac_read_search,cap_fowner+eip

我想要一个普通用户运行的进程,切换到另一个进程的netns,另一个进程由root用户运行。我需要做的是打开/proc/pid/ns/net,然后调用setns。 我已经为上面的可执行文件提供了许多功能,但它仍然显示Permission denied。有什么想法吗?

【问题讨论】:

    标签: linux-capabilities


    【解决方案1】:

    https://man7.org/linux/man-pages/man2/setns.2.html 建议:

    Network, IPC, time, and UTS namespaces
                  In order to reassociate itself with a new network, IPC,
                  time, or UTS namespace, the caller must have the
                  CAP_SYS_ADMIN capability both in its own user namespace
                  and in the user namespace that owns the target namespace.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-23
      • 2015-08-24
      • 2010-11-27
      相关资源
      最近更新 更多