su: cannot set user id: Resource temporarily unavailable

When you try to switch user and get the following error:

# su -
Password: 
su: cannot set user id: Resource temporarily unavailable

We can resolve the issue by editing the following values in /etc/security/limits.conf

# vi /etc/security/limits.conf

Now change the values in the file as below:

-------------
*          soft     nproc          2047
*          hard     nproc          16384
*          soft     nofile         1024
*          hard     nofile         65536
-------------

Now try again to switch as a super user.