Getting ulimit to work with SSH and s...

Getting ulimit to work with SSH and stick across reboots
 

Add the following to /etc/sysctl.conf
 
fs.file-max = 104032  (substitute 104032 for whatever is appropriate to your environment)
 
then run:
sysctl -p
 
Add the following to /etc/security/limits.conf: (note that ulimit -n always reports the soft limit so if no soft limit is set it will always report the default of 1024)
  *  soft  nofile   4096
  *  hard  nofile  104032
 
Add the following to /etc/pam.d/login:
 session    required     pam_limits.so
 
Add the following to /etc/pam.d/sshd:
 session    required     pam_limits.so
 
Add the following to /etc/ssh/sshd_config:
 UsePAM yes
 
then run:
service sshd restart
 
 
 
 

No comments: