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
相關文章
相關標籤/搜索