[admin@localhost ~]$ sudo su - scloan
Last login: Tue Jun 12 14:06:31 CST 2018 on pts/3
su: failed to execute /bin/bash: Resource temporarily unavailable
提示资源不足,查看系统内存和磁盘空间使用情况,未发现明细异常
其他账号都可正常切换登录,只有kkloan(ftp账号)存在问题
查看其提供的ftp服务连接数情况
[kkloan@localhost ~]$ netstat -antlp|grep -v tcp6|grep 10.156.43.39:22|grep ESTABLISHED|wc -l
(No info could be read for "-p": geteuid()=1001 but you should be root.)
5074
由此可见连接数已达5074,而系统默认设置ulimit -a最大仅为1024
解决如下:
[admin@localhost ~]$ egrep -v "^$|^#" /etc/security/limits.d/20-nproc.conf
* soft nproc 1024
root soft nproc unlimited
vim /etc/security/limits.d/20-nproc.conf
* soft nproc 50000 #将默认值1024改为50000
root soft nproc unlimited
再次ssh登录账户,ok,回复正常。
注:单独修改/etc/security/limits.conf 未可用!