CentOS 6 sudo: PERM_ROOT: setresuid(0, -1, -1): too many processes cPanel FIX

Author:
phil
Created:
Wednesday, April 23rd, 2014
Last Updated:
Thursday, January 26th, 2017

Disclaimer: Accessing the information on this page means you agree to the Sites Terms of Service


The Problem

If you're on a CentOS WHM hosting platform and added yourself as a sudo user in the wheel group but anytime you try to do sudo from your own account you get: sudo: PERM_ROOT: setresuid(0, -1, -1): too many processes the solution is actually super simple to fix.

First off, if you're getting this on any other Linux platform, I have no idea how to fix it... there are some posts out there on a few other errors and the fix points to adding more nproc limits for your user but in my case, my user had 35 processes it could use and I was only using 2 of those 35...

The Fix

To fix the annoying sudo: PERM_ROOT: setresuid(0, -1, -1): too many processes error, the steps are easy:

1) Login to your CentOS cPanel WHM hosting page.

2) Do a search over on the upper left for fork and the only result should come up as: Shell Fork Bomb Protection (click on the result)

3) On the "Shell Fork Bomb Protection" page, simply disable it and you're done! It's that easy!

I tried searching for a fix to what is a crazy simple solution to the problem and came up with absolutely nothing. The only page that seemed to be related was on the CentOS forums and it turned out to be a typical forum of "Here's a problem but nobody has a fix for it".

Hope this helps and as always, leave a comment if this got you going!

Post Comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Comments

What fixed this on my server:

The issue was resolved by editing the /etc/security/limits.d/90-nproc.conf file to allow root more open files. After that, sysctl -p /etc/sysctl.conf was used to make it take effect.

Clearly something done by a hosting provider. Yeah, I'm looking at you GoDaddy. They "couldn't"/wouldn't fix the problem on my last VPS, then I took 9+ days switching over to a new VPS just to find the same issue. Not much will make you more mad.

I'm running into the same thing and trying to find a cause/fix. While this below isn't confirmed to be a solution yet as my new server has me blocked out of root SSH access (they call it security, rat race, grrr).

http://crybit.com/solved-su-cannot-set-user-id-resource-temporarily-unav...

# su -
Password:
su: cannot set user id: Resource temporarily unavailable
OR
# sudo su -
RESPONSE: sudo: PERM_ROOT: setresuid(0, -1, -1): too many processes

Solution?:
Edit (add) or change the following values in /etc/security/limits.conf

# vi /etc/security/limits.conf
-------------
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
-------------

Try again to switch.