如何在linux中更改每个用户的默认最大进程数

Mal*_*tha 5 linux terminal process

我在更改 linux 中用户的默认进程数时遇到了问题。我试图通过添加以下行来编辑/etc/security/limits.conf文件。

malintha hard nproc 10000
Run Code Online (Sandbox Code Playgroud)

保存后,我尝试在终端上执行以下命令

ulimit -u
Run Code Online (Sandbox Code Playgroud)

它给出了先前的值 (1024) ,但不是更新后的值。我怎样才能永久解决这个问题?

这是我的limits.conf文件

小智 0

编辑该文件需要重新启动服务器,您可以使用更简单的方法:

chuser nofiles=10000 malintha
Run Code Online (Sandbox Code Playgroud)

与控制台断开连接并使用用户名再次重新连接malintha。现在使用ulimit -n 和输出应该是10000.