Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can use ulimit but I think that only affects my shell session. I want the limit increased for all processes. This is on Red Hat.

share|improve this question
Which version of Red Hat, by the way? RHEL5? – mattdm Mar 9 '11 at 18:07

Justin's answer tells you how to raise the number of open files available total to the whole system. But I think you're asking how to raise the per-user limit, globally. The answer to that is to add the following lines to /etc/security/limits.conf:

*               soft    nofile            2048
*               hard    nofile            2048

(Where the * means all users.)

There's some summary documentation in that file itself and in man limits.conf. This is implemented via the pam_limits.so module which is called for various services configured in /etc/pam.d/.

And, I have to admit, I have no idea where that 1024 default comes from. And believe me, I looked. I even tried without the pam_limits module configured, and it's still there. It must be hard-coded in somewhere, but I'm not exactly sure where.

share|improve this answer
Hmm... I set this properly. Exit SSH and come back in and my soft limit is still set to 1024. Is there something I'm missing to make this "active"? Thanks. – Josh Pinter Aug 6 '15 at 0:29

According to the article Linux Increase The Maximum Number Of Open Files / File Descriptors (FD), you can increase the open files limit by adding an entry to /etc/sysctl.conf.

Append a config directive as follows:

fs.file-max = 100000

Then save and close the file. Users need to log out and log back in again to changes take effect or they can just type the following command:

# sysctl -p

You can also verify your settings with the command:

# cat /proc/sys/fs/file-max
share|improve this answer
I'm skeptical about needing to log out and in again for this particular setting, which is system-wide. (That goes for pretty much everything in sysctl...) – mattdm Mar 9 '11 at 18:10

Increase max number of ulimit open file in Linux

1)Step : open the sysctl.conf and add this line fs.file-max = 65536

vi /etc/sysctl.conf add end of line fs.file-max = 65536

save and exit.

2)Step : vi /etc/security/limits.conf and add below the mentioned

* soft nproc 65535

* hard nproc 65535

* soft nofile 65535

* hard nofile 65535

save and exit check max open file ulimit

[root@localhost# ulimit -a


open files (-n) 65535

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.