一、操作:
修改/etc/security/limits.conf
- hard nofile 1200000
二、现象:
- ssh登录后退出
- 控制台登录后界面空白
三、定位:
使用光盘引导,进入Rescue System查看message
ssh登录相关日志
Apr 10 11:01:36 Linux sshd[14007]: Accepted keyboard-interactive/pam for usr_ins from 192.168.222.125 port 37472 ssh2
Apr 10 11:01:36 Linux sshd[14007]: pam_limits(sshd:session): Could not set limit for ‘nofile’: Operation not permitted
Apr 10 11:01:36 Linux sshd[14007]: error: PAM: pam_open_session(): Permission denied
控制台登录相关日志
Apr 10 11:01:50 Linux login[13736]: pam_limits(login:session): Could not set limit for ‘nofile’: Operation not permitted
Apr 10 11:01:50 Linux login[13736]: Permission denied
四、解决:
sysctl 设置 fs.nr_open 大于等于 /etc/security/limits.conf 的 hard nofile