我添加了2行
/etc/security/limits.conf myuser soft nofile 16384 myuser hard nofile 16384@H_502_3@……没有效果:
su - sysctl -p su myuser ulimit -n 1024@H_502_3@
解决方法
将其添加到/etc/security/limits.conf:
* soft nofile 16384 * hard nofile 16384@H_502_3@并将这样的内容添加到/ etc / profile中,它应该适用于所有帐户:
ulimit -n 16384@H_502_3@但是,为了让ssh和su等工具服从limits.conf文件,你需要将以下内容添加到相应的pam.d文件中(如果它还没有),即su添加到/etc/pam.d/su和对于ssh添加到/etc/pam.d/sshd:
session required /lib/security/pam_limits.so@H_502_3@