Linux resources using configuration files/etc/security/limits.conf and Ulimit

Source: Internet
Author: User

The limits.conf file is actually a pam_limits.so configuration file in Linux Pam, and only needles are for a single session.

The limits.conf format is as follows:

<domain> <type> <item> <value>

Domain has several formats that can be viewed with man limits.conf, but in general we are using the form of usernames and group names: username| @groupname

Set the user name that needs to be restricted, the group name is preceded by the @ and the user name differs. You can also use wildcard characters * to make all the restrictions.

Type: Soft,hard and-,soft refer to the setting value that the current system is in effect for, and the soft limit can also be interpreted as a warning value. The maximum value that can be set in the hard table name System. The soft limit cannot be higher than the hard limit, with the table name setting both the soft and hard values.

Item indicates the type of usage resource that needs to be restricted

Core limits the size of kernel files

Date Maximum data size

Fsize Maximum file size

Memlock Maximum lock memory address space

Nofile Maximum number of open files

RSS Max Persistent setting size

Stack maximum stack size

Maximum CPU time in minutes for CPU

Maximum number of noproc processes

As address space limitations

Maxlogins the maximum number of logins allowed for this user

If the limits.conf file configuration takes effect, you must make sure that the pam_limits.so file is added to the startup file to see the session in the/etc/pam.d/login file Required/lib/security/pam_ Limits.so

Ulimit command for the resource limit used by the shell startup process

Restrictions can generally be enforced by using the Ulimit command or by editing the/etc/security/limits.conf reload method.

The Ulimit comparison is straightforward, but only valid in the current session, limits.conf can be used by users and restrictions to enable the user to take effect in the next logon. The settings for limits.conf are valid through pam_limits.co loading, such as/etc/pam.d/sshd, which loads the limit when logged in via SSH, or when the/etc/pam.d/login load takes effect.

Linux resources using configuration files/etc/security/limits.conf and Ulimit

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.