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