Closed KellerFuchs closed 8 years ago
I believe all Linux versions since at least 3.8 support user namespaces. If you are a non-root user, you are in fact in a user namespace. The difference is whether "CAP_SYS_ADMIN" is set, which I would think is set unless you're inside of some sort of container.
@matthewbauer At least on Debian Jessie (even as of yesterday's point release), users do not have (by default) the right to create user namespaces:
% ./userns_child_exec -U
clone: Operation not permitted
(userns_child_exec
is a demo program that attempts to create a namespace)
@KellerFuchs confirming, wondering what debian is doing to forbid user namespaces... the jessie kernel has USER_NS=y
Yes. As I said, the support is there, but it's disabled (for security reasons, given user namespace's recent security history).
Anyhow, thanks a lot for documenting that in the README
.
@KellerFuchs do you have any link about this debian decision?
Not out of hand, sorry.
To allow nix-user-chroot to run on a recent Debian (Kernel 4.8) do:
sudo sh -c "echo 1 > /proc/sys/kernel/unprivileged_userns_clone"
had this in my notes...
@marvin2k The issue is not “giving people a command to run to enable the feature”, but also explain why it is a terrible idea, in many cases, to do so.
What is a terrible idea? Executing copy-n-paste snippets from the Internet? My hope was that by giving the command plus a link I could create pointers for others to further improve the situation ;-)
@marvin2k Enabling unprivileged user namespaces: the reason why they are disabled by default, in Debian at least, is that there has repeatedly been security issue with those (as in, “run 3 commands in your shell to become root”)
Ah Ok. The simplicity from nix-user-chroot stems from the power of user namespaces, so...?
Hi,
It would be less confusing for users were the requirement for successfully running
nix-user-chroot
were stated in the README file. In particular, it isn't stated that user namespaces support is required, and many distros and shell providers do not support this due to the associated security issues.