Ubuntu – nofile ulimit -n on Ubuntu 14.04 LTS

14.04ulimit

➜ sudo sysctl -a|grep file

fs.file-max = 2037581
fs.file-nr = 2784   0   2037581

➜ ~ cat /proc/sys/fs/file-max
2037581

➜ ~ cat /proc/sys/fs/file-nr
2720    0   2037581

/etc/security/limits.conf

* hard nofile 2037581
* soft nofile 2037581
root hard nofile 2037581
root soft nofile 2037581

/etc/pam.d/su

session required pam_limits.so

/etc/pam.d/common-session

session required pam_limits.so

then reboot.

but ulimit -n got 1024 again.

only can ulimit -n 4096 as max value

or got error

 ulimit: value exceeds hard limit

Best Answer

If u set root hard nofile 65535 it will only change root users limit. If you want to change another users limit add that users username for example,

sharewind hard nofile 65535 Or add * for username which will change all users limit. But it is not recommended.

Related Question