imz*_*hev 11 security not-root-user sysctl userns altlinux
我的 Linux 内核在构建时必须使用user_namespaces进行配置,但它们的使用在启动后受到限制并且必须显式启用。我应该使用哪个 sysctl?
(如果它被打开,这将允许运行像 一样的隔离命令unshare --user --map-root-user --mount-proc --pid --fork
,然后在chroot
没有 root身份的情况下执行——这是 Linux 备受期待的特性。)
imz*_*hev 18
众所周知,Debian(因此也可能是 Ubuntu)发布的内核具有这样的 user_namespaces 限制,并且启用它的方法是/是:
sysctl -w kernel.unprivileged_userns_clone=1
Run Code Online (Sandbox Code Playgroud)
(来源:https : //blog.mister-muffin.de/2015/10/25/unshare-without-superuser-privileges/。)
ALT 在kernel-image-std-def中也有这样的限制。与 Debian 不同,它被称为kernel.userns_restrict
.
通常为 1(即“受限”):
$ cat /proc/sys/kernel/userns_restrict
1
Run Code Online (Sandbox Code Playgroud)
为了实现这一点,echo 0 > /proc/sys/kernel/userns_restrict
(sysctl
当然,或者像上面一样使用)。
归档时间: |
|
查看次数: |
20925 次 |
最近记录: |