永久设置ubuntu ulimit

打开/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

posted on 2016-01-11 20:03  Xx0翼  阅读(3583)  评论(0编辑  收藏  举报