我的环境是 Ubuntu 10.10。我正在设置/etc/security/limits.conf
并启用 pam_limits.so 模块。
* soft nofile 64000
* hard nofile 65000
这不起作用:以 root 身份登录并运行ulimit -n
显示 1024。
我将其改为:
root soft nofile 64000
root hard nofile 65000
现在可以以 root 身份登录。
为什么星号不起作用?
答案1
因为通配符不适用于 root 用户。
DESCRIPTION
The syntax of the lines is as follows:
<domain> <type> <item> <value>
The fields listed above should be filled as follows:
<domain>
o a username
o a groupname, with @group syntax. This should not be confused
with netgroups.
o the wildcard *, for default entry.
o the wildcard %, for maxlogins limit only, can also be used with
%group syntax.
NOTE: group and wildcard limits are not applied to the root
user. To set a limit for the root user, this field must contain
the literal username root.