原来一直是可以登录的,自从放假回来,再用xshell就登录不上了。网上搜了一大堆答案,好像都不行。
现象:
1:日志内容(是我用root登录后查看的)
Feb 6 11:07:19 hostA sshd[32309]: Accepted password for tomcat from 115.197.x.x port 27073 ssh2
Feb 6 11:07:19 hostA sshd[32309]: pam_unix(sshd:session): session opened for user tomcat by (uid=0)
Feb 6 11:07:19 hostA sshd[32311]: fatal: setresuid 500: Resource temporarily unavailable
Feb 6 11:07:19 hostA sshd[32309]: pam_unix(sshd:session): session closed for user tomcat
2:xshell显示内容
Connecting to 114.215.x.x:22...
Connection established.
To escape to local shell, press Ctrl+Alt+].
Connection closed by foreign host.
Disconnected from remote host(testA) at 11:07:25.
Type `help‘ to learn how to use Xshell prompt.
3:使用root切换tomcat,报如下错误
[root@hostA ~]# su tomcat
su: cannot set user id: Resource temporarily unavailable
===============================================================
解决办法:
1:vim /etc/security/limits.d/90-nproc.conf
* soft nproc 65535 <---此数值该大点
2:sysctl -p
另外:
nproc表示为用户进程数。
查看文件打开数:lsof |grep tomcat|wc -l
查看用户进程数:ps -U tomcat |wc -l
参考内容戳这里 <--
本文出自 “随风” 博客,请务必保留此出处http://358778493.blog.51cto.com/11386071/1895237
原文:http://358778493.blog.51cto.com/11386071/1895237