ulimit
PAM模块
ssh 开启 pam 模块后应修改以下文件
- /etc/pam.d/su
- /etc/pam.d/sshd
- /etc/pam.d/login
- /etc/pam.d/cron
添加如下内容
session required pam_limits.so
重启生效
systemctl restart sshd
修改/etc/security/limits.conf
文件,用户列不能用*
号,否则root
登录后执行ulimit -n
值不对
root soft nofile 1048567
root hard nofile 1048567
root soft nproc 65535
root hard nproc 65535
NOTE: group and wildcard limits are not applied to the root user. To set a limit for the root user, this field must contain the literal username root.