这发生在 Ubuntu Release 12.04(精确)64 位内核 Linux 3.2.0-25-virtual
我正在尝试增加允许用户打开的文件数。这适用于我的 eclipse java 应用程序,其中 1024 的当前限制是不够的。
根据到目前为止我发现的帖子,我应该能够将行放入
/etc/security/limits.conf 像这样:
soft nofile 4096
hard nofile 4096
Run Code Online (Sandbox Code Playgroud)
增加允许所有用户打开的文件数。
但这对我不起作用,我认为问题与该文件无关。
对于所有用户,默认限制为 1024,无论 /etc/security/limits.conf 中的内容如何(更改该文件后我重新启动)
$ ulimit -n
1024
Run Code Online (Sandbox Code Playgroud)
现在,尽管 /etc/security/limits.conf 中的条目我无法增加:
$ ulimit -n 2048
Run Code Online (Sandbox Code Playgroud)
-bash: ulimit: open files: cannot modify limit: Operation not allowed 奇怪的是我可以向下改变限制,但不能向上改变 - 甚至回到低于原始限制的数字:
$ ulimit -n 800
$ ulimit -n
800
$ ulimit -n 900
-bash: ulimit: open files: cannot modify limit: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
作为 root,我可以将限制更改为任何我想要的,向上或向下。它甚至似乎都不关心 /proc/sys/fs/file-max 中所谓的系统范围限制 …
我的问题是关于 LXC 容器的安全性。
如果我在我的机器上运行多个容器,并为用户提供对他们拥有的容器的单独 ssh 访问权限,那么这些容器中的任何一个是否可以入侵该机器上的其他容器甚至主机?
lxc 容器安全边界在哪里?