ubuntu設置ulimit


centos系統的設置ulimit的時候是直接修改/etc/security/limits.conf文件,但是在ubuntu中卻不行,

ubuntu先修改/etc/security/limits.conf文件

* soft     nproc          65535
* hard     nproc          65535
* soft     nofile         65535
* hard     nofile         65535

root soft     nproc          65535
root hard     nproc          65535
root soft     nofile         65535
root hard     nofile         65535
注意L這個每個用戶都要配置,有些說只有root用戶才需要寫出來,但是有時候測試的時候發現普通用戶沒有寫在這沒有生效
test soft     nproc          65535
test hard     nproc          65535
test soft     nofile         65535
test hard     nofile         65535

添加common-session
在/etc/pam.d/common-session文件中,添加下面一行內容
session required pam_limits.so

重啟系統就可以生效
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM