打开/etc/security/limits.conf
添加
* hard nofile 65535 * soft nofile 65535 root hard nofile 65535 root soft nofile 65535
或者直接执行
echo "* hard nofile 65535 * soft nofile 65535 root hard nofile 65535 root soft nofile 65535">>/etc/security/limits.conf
修改
vim /etc/pam.d/su
注释掉(默认已经是注释掉)
session required pam_limits.so
搞定,重启即可。。。重启后可以查看ulimit -n是否显示为65535