CentOS6/Linuxsu: unable to set user ID: Resource temporarily unavailable
System Environment: CentOS 6.5
When switching user doiido using su today, the following error occurs:
# Su-doiido
Su: unable to set user ID: Resource temporarily unavailable
At the same time, remote SSH tools such as SecureCRT cannot be connected using the doiido user.
Find the relevant information and find that/etc/security/limits exists in CentOS 6. d/90-nproc.config file, which limits the maximum number of threads for normal permission users. When the maximum number of threads for this user reaches the maximum number of user processes, the user cannot connect to log on. Therefore, this parameter can only be modified when the thread cannot be reduced. The specific modification method is as follows:
1. View max user processes
# Su-doiido
Su: unable to set user ID: Resource temporarily unavailable
# Ulimit-u
1024
We can see that the maximum number of threads is 1024.
2. Modify max user processes
# Vi/etc/security/limits. d/90-nproc.conf
* Soft nproc 1024
Root soft nproc unlimited
As shown above, all users except for the root user are limited to 1024. Therefore, this problem can be solved by commenting on this line or changing the value to a greater value.
Save and exit after modification is complete. Such modification takes effect immediately (tested)
3. You can also modify the/etc/security/limits. conf file. The Modification result is as follows:
# Cat/etc/security/limits. conf
Doiido soft nproc 2047
Doiido hard nproc 16384
Doiido soft nofile 1024
Doiido hard nofile 65535
Note: This file is not available in CentOS 5.