It's well-known that processes that are capable of using
chroot
, are capable of breaking out of achroot
. Sinceunshare -r
would grantchroot
permissions to an ordinary user, it would be a security risk if that was allowed inside achroot
environment. Indeed, it is not allowed, and fails with:unshare: unshare failed: Operation not permitted
que corresponde ao sem compartilhamento (2) documentação (desculpas pelo ousado estranho, mas é isso que parece):
EPERM (since Linux 3.9)
CLONE_NEWUSER was specified in flags and the caller is in a chroot environment (i.e., the caller's root directory does not match the root directory of the mount namespace in which it resides).