The problem that ulimit cannot be executed using sudo in linux

Source: Internet
Author: User
First look at what ulimit is: submit :...

First Look what ulimit is: http://baike.baidu.com/view/4832100.htm

In linux, you can use ulimit to modify the maximum number of files simultaneously opened by a process.

However, if your account is not a root account, but has sudo permissions

Sudo ulimit-n 65535

When you encounter: sudo: ulimit: command not found

The cause of the problem has not been finalized

Solution:

Sudo vi/etc/pam. d/su
 
Add pam_limits.so module reference
Session required pam_limits.so
 
Then set the limit on the number of opened files for the account. we recommend that you set it to * (all accounts)
 
Edit sudo vi/etc/security/limits. conf file
 
* Soft nofile 4084
* Hard nofile 4084
 

OK, reboot it, and then you can see it takes effect through ulimit-.

From: sumekey blog

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.