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.
Copyright © weiliang 2021 all right reserved,powered by Gitbook本书发布时间: 2024-04-22 16:03:41

results matching ""

    No results matching ""