本文为摘录,原文为: https://mydbops.wordpress.com/2017/12/10/ulimit-conflict-with-pam-and-systemd%E2%80%8B%E2%80%8B%E2%80%8B/#content

1 ulimit 是做什么的

User limits command, limit the use of system-wide resources.

2 ulimit 从哪里读取配置文件

  • 从下面的文件、目录中读取配置文件

    • /etc/security/limits.conf
    • /etc/security/limits.d/*.conf
  • 默认从前者读取,然后用后面的文件中读取来覆盖前者。

  • 目录 etc/security/limits.d 中的文件,按照 C locale 的顺序来读取、解析并应用

3 How PAM Modules related to /etc/security/limit.d/*.conf

  • The pam_limits PAM module sets limits on the system resources that can be obtained in a user session.
  • When accessing a system via ssh through sshd the /etc.pam.d/sshd policy file is consulted.