
We often refer to these privileged accounts as superusers or administrators. Since actions such as accessing restricted information, adding or deleting users and reconfiguring applications have security and operational ramifications, only trusted users should have the relevant access to perform these tasks. Therefore, increasing the platform's security requires an organization to limit the number of users who have privileges to access administrative functions. The principle of least privilege states that every user should only have the access they need to perform their duties and nothing more.

This role-based security model offers system administrators greater control and determines the actions each user can perform on the system. We can use maxlogins item to limit the number of logins of users of groups to the system.Every technology system manages its security by providing users with different levels of access. So to avoid the security issue, we can limit the number of logins of the user or group of users. So to limit the maximum 227 number of files that can be opened by user gfg use the following limit gfg hard nofile 227 Limit Number Of Loginsīy default, systems allow us to unlimited logins on the system, but it can create a security issue. Nofile is an item by using which we can limit the maximum number of files that can be opened by the user. So to limit the CPU time 1000 cycle to user gfg uses the following limit: gfg soft cpu 0000 Limit Number Of Open File There is another item called cpu which is used to limit the CPU time for the mentioned user or group. gfg hard nproc 50Īfter applying this limit, the user gfg will maximum own 50 processes. So limit the number of processes for user gfg use the following limit. There is one item called nproc by using this option we can limit the number for the user or group ID. Now let’s explore more items than mentioned above list. This limit will be applied to Group IDs in the range between 500 and 505.

Same as for user IDs, when we have to apply the same limit to multiple group IDs we can specify the range of group IDs. This limit will be applied to the user IDs in the range of 1000 to 1020. Here is an example: 1000:1020 hard nproc 50 When we mention the user ID range, then the mentioned limit is applied to user IDs that belong to that range. When we want to specify one limit to the multiple users, but the users do not belong to the same group, we can specify the range of the user for which the limit has to apply. * - maxsyslogins 20Īfter applying this limit, the maximum number of logins to the system is 20. Here is an example with a wildcard to apply limited number of logins on the system. To apply the limit to the whole system, we can use this wildcard domain.

We had seen the one domain as the * (asterisk). Here is one example with employee group employee hard nproc 30 Using wildcards to apply limits To limit the group we can use the same format and value used for value and item but instead of username mention the group name. Here is our limit : gfg hard cpu 10 Limit for Group 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. 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. After that we have to mention the type of limit, in this example, we set hard type. So to limit users, we need to mention username as a domain field. We are going to understand this by taking an example. Now let’s see how we can limit the user by using the nf file. This field stores the values for the mentioned limit. To see all values of this field, please read the man of nf value This field mentions which resource we are going to limit for the mentioned domain.
LIMIT STANDARD ACCOUNTS UBUNTU HOW TO

