<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 16, 2017 at 12:21 PM, Dr. Todor Dimitrov <span dir="ltr"><<a href="mailto:dimitrov@technology.de" target="_blank">dimitrov@technology.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>My understanding is that the unprivileged user owning the container can still alter the cgroups, right?</div><div><br></div></div></blockquote><div><br></div><div><br></div><div>You should really try lxd. e.g. <a href="https://linuxcontainers.org/lxd/try-it/">https://linuxcontainers.org/lxd/try-it/</a> , or install it on your own ubuntu server/vm.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>The use case that we have in mind is to allow an unprivileged user run a preconfigured container, which configuration is only writable for power users. Ideally the unprivileged user should not be able to meddle with the cgroups or even create new containers.</div><div><br></div><div>Is such a scenario feasible to implement using LXC and cgroups?</div></div></blockquote><div><br></div><div><br></div><div>That's what lxd does. Sort of. Some options:</div><div>- you create an unpriv container (the default in lxd), then give access to the container (e.g. ssh keys, root pass of the container, etc) to the user. They will be able to restart the container and install whetever package they want, but they can't create another container</div><div><br></div><div>- you create an unpriv container with nesting enabled (which is what the try-me link does). The unpriv user will have a set of limits (e.g. total disk space, total memory, etc) which they can use to create containers under it.</div><div><br></div><div>In either way, the container's root user will not be able to alter it's own cgroup configuration (e.g. /sys/fs/cgroup/memory/memory.limit_in_bytes). </div><div><br></div><div>-- </div><div>Fajar</div></div></div></div>