Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you permanently set process limit per user (ulimit -u) in Ubuntu?

share|improve this question
up vote 9 down vote accepted

Edit /etc/security/limits.conf and configure nprocs appropriately.

You may need to add pam_limits to your pam configuration. The default configuration has pam_limits configured for many services. You may want to add pam_limits to /etc/pam.d/common-session.

share|improve this answer
I think you may need to make some changes in /etc/pam.d as well. – belacqua Apr 11 '11 at 18:17
I'm not 100% sure the PAM changes are still required, but they used to be -- was trying to grok some related bug reports, but it'd be easier to test it, I think. – belacqua Apr 11 '11 at 18:30
@jgbelacqua: They are there for all the common login methods (login, sum sudo, and *dm) methods as well as cron methods for 10.4 and 10.10. – BillThor Apr 11 '11 at 18:34
A better description of this solution here: – e_x_p Jan 6 '13 at 19:16

Edit /etc/security/limits.conf, making changes per the examples and for the limits you want.

You'll also need to add a line to the /etc/pam.d/common-session file:

session required

The change to PAM modules may be necessary elsewhere, but generally, common-session is included related configurations, e.g.,

$ grep common-session /etc/pam.d/sshd :     

   sshd:@include common-session
share|improve this answer
Thank you, I'll vote up your answer when I get enought points :) – Andrej Cimperšek Apr 11 '11 at 18:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.