limits.conf不生效问题

转自:http://q.pnq.cc/blog/2015/08/09/why-the-limits-config-not-hornored/ bash

正常状况下, /etc/security/limits.conf 的改动,应该在下次访问时就生效才对。session

如不生效多是如下几个缘由:
ssh

1. 确保 pam 生效

在 /etc/pam.d/login 中,存在:ide

session required pam_limits.so

2. 确保 ssh 使用 pam

在 /etc/pam.d/sshd 中,存在:ui

session required pam_limits.so

在 /etc/ssh/ssd_config 中, 存在:spa

UsePAM yes

3. limits.conf 建议不要使用星号

官方 manual 以及网上的教程有不少都用了 * 符号,然而不是全部系统都认的code

# 不兼容方式:
* soft nofile 51200
* hard nofild 51200
# 兼容方式
root soft nofile 51200
root hard nofile 51200
qhwa soft nofile 51200
qhwa hard nofile 51200
相关文章
相关标签/搜索