gpt4 book ai didi

linux - 取消共享和 newuidmap : update

转载 作者:行者123 更新时间:2023-12-04 16:55:30 26 4
gpt4 key购买 nike

我正在尝试使用自己的命名空间创建一个进程,然后进行 uid(可能还有 gid)映射。我正在关注 this questionthis answer ,但是,如 this recent comment 所示,它不再起作用。

这里是瘦子。首先,你在一个新的命名空间中创建一个进程 unshare :

unshare -U bash

并获取它运行的进程,使用 echo $$或诸如此类。你获取那个PID,然后从另一个shell,你去:
newuidmap 12394 0 0 1

如上面的评论所示,答案是:
newuidmap: uid range [0-1) -> [0-1) not allowed

在对答案的更新中, Arks mentions :

it is something with settings in /etc/subuid and /etc/subguid files



但是,我无法弄清楚它们的含义。任何的想法?

最佳答案

仍然不明白为什么 newuidmap 不起作用。但是this article显示写入 /proc/$$/uid_map

echo '5 1000 1' > /proc/14671/uid_map

这是一个不能重复的一次性操作,并在单个命令中建立 UID 和 GID 的映射。

关于linux - 取消共享和 newuidmap : update,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62323015/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com