su: cannot set user id: Resource temporarily unavailable

When attempting to use su, you may receive the following error:

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

This is caused by the PAM limits.conf file. Often (always?) it's because the target user has exceeded the max number of processes allowed. You can verify this with ps.

# ps -eLF |grep otheruser |wc -l
1127

In this case, 1127 is greater than the max allowed of 1024. To fix this, set the nproc limit higher, or stop any unwanted processes.

# cat /etc/security/limits.d/otheruser.conf
otheruser soft 4096

Subscribe to Comments for "su: cannot set user id: Resource temporarily unavailable" Subscribe to zmonkey.org - All comments