SSH "accept : too many open files" on OS X when using Burp
EDIT 19.04.2013 10:17 ---
WARNING! This did break the Tor Browser Bundle on my machine. The error was "Couldn't set maximum number of file descriptors: Invalid argument"
For as long as I can remember, when using SSH as a forward proxy to proxy Burp Suite through an upstream server I have gotten a "accept : too many open files" error in my Mac OS X Terminal after a couple of hours of using Burp's Proxy and/or Scanner.
When searching Google the first solution I came across was to set the 'ulimit' to something higher, as far as I can tell 'ulimit' sets user system limits such as how many open files a user is allowed to have open at once.
On OS X when attempting to set this limit to 'unlimited' I always got an error, "Neither the hard nor soft limit for "maxfiles" can be unlimited. Please use a numeric parameter for both.", or when setting the ulimit to something higher than the default (256) the error (accept : too many open files) would still not go away or at least not for long. The only thing I found that would get rid of the error was to kill my ssh session and spawn a new one.
After further reading, some forums and blogs suggested updating openssh, I did this and the issue persisted. I thought the issue may have been openssl, so I updated that, the issue persisted.
I also tweeted about the issue where the suggestion of adjusting the ulimit resurfaced, but I just couldn't get ulimit to fix the issue.
Finally, I came across this post on superuser.com where the errant.info user suggests to issue the following commands:
As far as I can tell, the above seems to set a kernal limit, system limit and also the user's ulimit. After a system restart, the error has now gone!
The user also adds some additional notes:
I'm sure I am not the only one who has come across this before, so hopefully it is useful to other Burp Suite user's who use SSH as a forwarding proxy on Mac OS X. It worked for me so should hopefully work for you too.