Solve ssh logon error-bash fork retry Resource temporarily unavailable
An error is reported when a non-root user logs on to SSH. bash fork retry Resource temporarily unavailable.
This problem may be caused by/etc/security/limits. the nproc in the d/90-nproc.conf file has reached the upper limit, or the above configuration file has been released only for specific users, while other users still have restrictions.
The 90-nproc.conf here may be a machine.
The solution is to modify the nproc ceiling or the corresponding user account, and then restart the system to take effect.
Note: This file is only available after CentOS 6 and is not available in CentOS 5.10.
Perform the following steps:
1. cp-a/etc/security/limits. d/90-nproc.conf/etc/security/limits. d/90-nproc.conf.bak
Note: This operation is a backup file, which can be used for restoration to avoid Operation errors.
2. vim/etc/security/limits. d/90-nproc.conf
# Default limit for number of user's processes to prevent
# Accidental fork bombs.
# See rhbz #432903 for reasoning.
* Soft nproc 1024
Here, change 1024 to a greater value and set it as needed. For example, set it to 1500.
# Default limit for number of user's processes to prevent
# Accidental fork bombs.
# See rhbz #432903 for reasoning.
* Soft nproc 1500
If there is a limit on a specific user, modify the corresponding row content. For example:
# Default limit for number of user's processes to prevent
# Accidental fork bombs.
# See rhbz #432903 for reasoning.
Mayun soft nproc 1024
* Soft nproc 1500
To:
# Default limit for number of user's processes to prevent
# Accidental fork bombs.
# See rhbz #432903 for reasoning.
Mayun soft nproc 2000
* Soft nproc 1500
3. init 6
Note: restart the system
In addition, if this does not work, you can kill some processes of this user. If so, a process of this user has a loop and has been occupying some resources.