centos7系统root无法通过su切换到某个普通用户

[root@test ~]# su webapp
su: failed to execute /bin/bash: Resource temporarily unavailable

[root@test ~]# egrep -v "^$|^#" /etc/security/limits.d/20-nproc.conf
* soft nproc 4096
root soft nproc unlimited

[root@test ~]# vim  /etc/security/limits.d/20-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

* soft nproc 65535
root soft nproc unlimited


[root@test ~]# su webapp
[webapp@test root]$

原文地址:https://www.cnblogs.com/wyzhou/p/10544720.html