Limit for user
Now let’s see how we can limit the user by using the limits.conf file. We are going to understand this by taking an example. So to limit users, we need to mention username as a domain field. In this example, GFG is the user. After that we have to mention the type of limit, in this example, we set hard type. Now to set items first we are needed to choose any item from the available item so in this example, we have chosen to use CPU item. Now we have to mention value the value of item CPU is must be in minutes, so for this example let’s mention the value as 10 minutes. Here is our limit :
gfg hard cpu 10
limits.conf File To Limit Users, Process In Linux With Examples
Linux gives full control over the system. In this article, we are going to learn about the file limits.conf. limits.conf is a configuration that is used to limit the resources to the user, groups. Now let’s understand the file structure of limits.conf and how can we use the limits.conf to limit resources to the user. Before moving further, note that to edit this file, you must have root permission.
The complete path of the limits.config is :
/etc/security/limits.conf
pam_module is a module that uses ulimit command to apply limits from limits.conf file.
The basic syntax of the limits.conf file is :
<domain><type><item><value>
Now let’s understand each field one by one