Skip to content

Instantly share code, notes, and snippets.

@bububa
Created September 3, 2012 06:02
Show Gist options
  • Save bububa/3607104 to your computer and use it in GitHub Desktop.
Save bububa/3607104 to your computer and use it in GitHub Desktop.
reset ulimit
# vi /etc/security/limits.conf
[Modify or add "nofile" (number of file) entries - note
that a userid can be used in place of *]
* soft nofile 64000
* hard nofile 64000
# vi /etc/pam.d/login
[Add the line]
session required /lib/security/pam_limits.so
[On many systems this will be sufficient - log in as a regular
user and try it before doing the following steps]
[These steps may be required depending on how PAM and ssh are configured
[Note on some systems - Debian?]
# vi /etc/pam.d/ssh
[Note on other systems - RedHat]
# vi /etc/pam.d/sshd
[Add the line]
session required /lib/security/pam_limits.so
# vi /etc/ssh/sshd_config
[May need to modify or add the line]
UsePrivilegeSeparation no
[Restart the ssh daemon]
[Note on some systems - Debian?]
# /etc/init.d/ssh reload
[Note on other systems - RedHat]
# /etc/rc.d/init.d/sshd reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment