limits.conf文件

limits.conf configuration file is used to limit user, domain, process related metrics. Limits.conf is related with pam_limits module.

limits.conf配置文件用于限制用户,域,进程相关指标。 Limits.conf与pam_limits模块相关。

配置文件 (Configuration File)

There is configuration file named limits.conf and located at /etc/security/ . The default content of this file is like below.

/etc/security/有一个名为limits.conf配置文件。 该文件的默认内容如下。

#<domain>      <type>  <item>         <value>
# #*               soft    core            0
#root            hard    core            100000
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#ftp             -       chroot          /ftp
#@student        -       maxlogins       4

As we can see all configurations are commented so they are not effective. There is also a directory which is use to store configuration files in a separate files to maintain easily. This location is /etc/security/limits.d/ . It is by default empty but we can create rules in this directory easily.

如我们所见,所有配置均已注释,因此它们无效。 还有一个目录,用于将配置文件存储在单独的文件中,以便于维护。 该位置是/etc/security/limits.d/ 。 默认情况下为空,但是我们可以在此目录中轻松创建规则。

句法 (Syntax)

Limits.conf file have a simple and reliable syntax. This syntax is defined to easily set context, type, limits and related values. We will look all of this terms below.

Limits.conf文件具有简单可靠的语法。 定义此语法可轻松设置上下文,类型,限制和相关值。 我们将在下面查找所有这些术语。

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

域 (Domain)

While limits configuration we need to specify context. This content can be defined in various ways and various parameters. The first column of the rule is the domain. Domain can be following

在限制配置的同时,我们需要指定上下文。 可以以各种方式和各种参数定义此内容。 规则的第一列是域。 域可以是

  • username用户名
  • groupname组的名字
  • * specifies all

    *指定全部

  • userid用户身份
  • groupid组号

类型(Type)

While limiting there is two type of limit implementation. These are called hard and soft .

限制时有两种限制实现方式。 这些被称为hardsoft

Hard limits are set by root and enforced by kernel

硬限制由root设置并由内核执行

Soft limits have some range overload.

软限制具有一定范围的过载。

项目 (Item)

Items are the core of limits. Items are used to specify the item the limit will be applied. For example if we want to limit the maximum process number we will use nproc numbers. Here are some of the items those can be used to for limit operation

项目是限制的核心。 项目用于指定将应用限制的项目。 例如,如果我们想限制最大进程数,我们将使用nproc数。 以下是一些可用于极限操作的项目

  • fsize specifies maximum file size

    fsize指定最大文件大小

  • nofile specifies maximum number of file size

    nofile指定最大文件大小

  • cpu specifies maximum CPU time

    cpu指定最大CPU时间

  • nproc specifies maximum number of process

    nproc指定最大进程数

  • maxlogins specifies maximum number of logins

    maxlogins指定最大登录数

  • maxsyslogins specifies maximum number of logins for all users

    maxsyslogins指定所有用户的最大登录数

.u35e1065dce315a3494678986e4a03813 , .u35e1065dce315a3494678986e4a03813 .postImageUrl , .u35e1065dce315a3494678986e4a03813 .centered-text-area { min-height: 80px; position: relative; } .u35e1065dce315a3494678986e4a03813 , .u35e1065dce315a3494678986e4a03813:hover , .u35e1065dce315a3494678986e4a03813:visited , .u35e1065dce315a3494678986e4a03813:active { border:0!important; } .u35e1065dce315a3494678986e4a03813 .clearfix:after { content: ""; display: table; clear: both; } .u35e1065dce315a3494678986e4a03813 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u35e1065dce315a3494678986e4a03813:active , .u35e1065dce315a3494678986e4a03813:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u35e1065dce315a3494678986e4a03813 .centered-text-area { width: 100%; position: relative; } .u35e1065dce315a3494678986e4a03813 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u35e1065dce315a3494678986e4a03813 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u35e1065dce315a3494678986e4a03813 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u35e1065dce315a3494678986e4a03813:hover .ctaButton { background-color: #E67E22!important; } .u35e1065dce315a3494678986e4a03813 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u35e1065dce315a3494678986e4a03813 .u35e1065dce315a3494678986e4a03813-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u35e1065dce315a3494678986e4a03813:after { content: ""; display: block; clear: both; }

LEARN MORE  Linux hosts.allow and hosts.deny To Control Network Access

.u35e1065dce315a3494678986e4a03813 , .u35e1065dce315a3494678986e4a03813 .postImageUrl , .u35e1065dce315a3494678986e4a03813 .centered-text-area { min-height: 80px; position: relative; } .u35e1065dce315a3494678986e4a03813 , .u35e1065dce315a3494678986e4a03813:hover , .u35e1065dce315a3494678986e4a03813:visited , .u35e1065dce315a3494678986e4a03813:active { border:0!important; } .u35e1065dce315a3494678986e4a03813 .clearfix:after { content: ""; display: table; clear: both; } .u35e1065dce315a3494678986e4a03813 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u35e1065dce315a3494678986e4a03813:active , .u35e1065dce315a3494678986e4a03813:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u35e1065dce315a3494678986e4a03813 .centered-text-area { width: 100%; position: relative; } .u35e1065dce315a3494678986e4a03813 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u35e1065dce315a3494678986e4a03813 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u35e1065dce315a3494678986e4a03813 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u35e1065dce315a3494678986e4a03813:hover .ctaButton { background-color: #E67E22!important; } .u35e1065dce315a3494678986e4a03813 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u35e1065dce315a3494678986e4a03813 .u35e1065dce315a3494678986e4a03813-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u35e1065dce315a3494678986e4a03813:after { content: ""; display: block; clear: both; }

了解更多Linux hosts.allow和hosts.deny来控制网络访问

指定用户限制(Specify User For Limit)

Now we can start examples. As we stated we can limit relevant items according to user name. In the following rule we will specify a limit for username ismail where we specify the user name in the first column.

现在我们可以开始例子。 如前所述,我们可以根据用户名限制相关项目。 在以下规则中,我们将为用户名ismail指定一个限制,我们在第一列中指定用户名。

ismail            hard    core            100000

In this example we set core or CPU limit for value 1000000 for username ismail as hard

在此示例中,我们为用户名ismail1000000设置了core或CPU限制为hard

指定限制组 (Specify Group For Limit)

In this example we can specify limit for a user group name. This type of limitation can be useful if we want to restrict some user group names.

在此示例中,我们可以为用户组名称指定限制。 如果我们要限制某些用户组名称,则这种类型的限制会很有用。

@apache        hard    nproc           20

In this example we specify apache group name to limit process number as maximum 20

在此示例中,我们指定apache组名称以将process号限制为最大20

使用通配符限制 (Use Wildcard For Limit)

While specifying the domain or the users and groups we may need to set limit for all users and groups in a system. Here we will use * or wildcard for this.

在指定域或用户和组时,我们可能需要为系统中的所有用户和组设置限制。 在这里,我们将使用*或通配符。

*               hard    rss             10000

In this example we set rss limit for all users and groups in this systems.

在此示例中,我们为该系统中的所有用户和组设置了rss限制。

指定限制的用户ID范围 (Specify User ID Range For Limit)

We want to specify limit some users. But they are not in a user group and we do not want or can create group for these groups. Specifying limits one by one is a problem. We can specify multiple users like below. But the restriction is that we will specify range

我们要指定限制一些用户。 但是它们不在用户组中,我们不希望或不能为这些组创建组。 一个一个地指定限制是一个问题。 我们可以指定多个用户,如下所示。 但限制是我们将指定范围

1000:1010               hard    rss             10000

The rule above will be applied to the users those User ID’s are between 1000 and 1010 . The : operator used to specify range.

上面的规则将应用于用户ID在10001010之间的用户。 :运算符用于指定范围。

.u2a55df3283ca946d9e7577e0df67dbd7 , .u2a55df3283ca946d9e7577e0df67dbd7 .postImageUrl , .u2a55df3283ca946d9e7577e0df67dbd7 .centered-text-area { min-height: 80px; position: relative; } .u2a55df3283ca946d9e7577e0df67dbd7 , .u2a55df3283ca946d9e7577e0df67dbd7:hover , .u2a55df3283ca946d9e7577e0df67dbd7:visited , .u2a55df3283ca946d9e7577e0df67dbd7:active { border:0!important; } .u2a55df3283ca946d9e7577e0df67dbd7 .clearfix:after { content: ""; display: table; clear: both; } .u2a55df3283ca946d9e7577e0df67dbd7 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u2a55df3283ca946d9e7577e0df67dbd7:active , .u2a55df3283ca946d9e7577e0df67dbd7:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u2a55df3283ca946d9e7577e0df67dbd7 .centered-text-area { width: 100%; position: relative; } .u2a55df3283ca946d9e7577e0df67dbd7 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u2a55df3283ca946d9e7577e0df67dbd7 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u2a55df3283ca946d9e7577e0df67dbd7 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u2a55df3283ca946d9e7577e0df67dbd7:hover .ctaButton { background-color: #E67E22!important; } .u2a55df3283ca946d9e7577e0df67dbd7 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u2a55df3283ca946d9e7577e0df67dbd7 .u2a55df3283ca946d9e7577e0df67dbd7-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u2a55df3283ca946d9e7577e0df67dbd7:after { content: ""; display: block; clear: both; }

LEARN MORE  Linux Bash Environment Variables

.u2a55df3283ca946d9e7577e0df67dbd7 , .u2a55df3283ca946d9e7577e0df67dbd7 .postImageUrl , .u2a55df3283ca946d9e7577e0df67dbd7 .centered-text-area { min-height: 80px; position: relative; } .u2a55df3283ca946d9e7577e0df67dbd7 , .u2a55df3283ca946d9e7577e0df67dbd7:hover , .u2a55df3283ca946d9e7577e0df67dbd7:visited , .u2a55df3283ca946d9e7577e0df67dbd7:active { border:0!important; } .u2a55df3283ca946d9e7577e0df67dbd7 .clearfix:after { content: ""; display: table; clear: both; } .u2a55df3283ca946d9e7577e0df67dbd7 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u2a55df3283ca946d9e7577e0df67dbd7:active , .u2a55df3283ca946d9e7577e0df67dbd7:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u2a55df3283ca946d9e7577e0df67dbd7 .centered-text-area { width: 100%; position: relative; } .u2a55df3283ca946d9e7577e0df67dbd7 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u2a55df3283ca946d9e7577e0df67dbd7 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u2a55df3283ca946d9e7577e0df67dbd7 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u2a55df3283ca946d9e7577e0df67dbd7:hover .ctaButton { background-color: #E67E22!important; } .u2a55df3283ca946d9e7577e0df67dbd7 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u2a55df3283ca946d9e7577e0df67dbd7 .u2a55df3283ca946d9e7577e0df67dbd7-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u2a55df3283ca946d9e7577e0df67dbd7:after { content: ""; display: block; clear: both; }

了解更多Linux Bash环境变量

指定限制的组ID范围(Specify Group ID Range For Limit)

The similar definition like previous user range is group range. We will specify group ID range like below.

类似于先前的用户范围的定义是组范围。 我们将如下指定组ID范围。

@500:510               hard    rss             10000

In this example the rules will be applied for the group ID’s between 500 and 510 . We use @ operator to specify ID’s as group and : for range.

在此示例中,规则将应用于500510之间的组ID。 我们使用@运算符将ID指定为组,将:指定范围。

限制工序数 (Limit Number of Process)

Now we will start to look different item types to use. There are more items than described here but these are most popular ones. First example is limiting number of processes for a user.

现在,我们将开始寻找要使用的不同项目类型。 有比这里描述更多的项目,但这些是最受欢迎的项目。 第一个示例是限制用户的进程数。

ismail        hard    nproc           20

In the example we limit process number with nproc item. The user the rule will apply is ismail and the maximum number of process for this user can own is 20

在示例中,我们将进程号限制为nproc项目。 规则将应用的用户是ismail ,该用户可以拥有的最大进程数为20

限制CPU时间 (Limit CPU Time)

Another useful item to limit is CPU time. We can set limits about the CPU time .

要限制的另一个有用项是CPU时间。 我们可以设置有关CPU时间的限制。

ismail           soft    cpu             10000

In this example we applied maximum 10000 cycles for user ismail by using cpu item.

在此示例中,我们使用cpu项目为用户ismail应用了最多10000个周期。

限制打开文件数 (Limit Number Of Open File)

We can limit the numbers of file a user can open in time. This can be useful to prevent disk bottlenecks if the system have a lot of users those access files.

我们可以限制用户可以及时打开的文件数。 如果系统有许多访问文件的用户,这对于防止磁盘瓶颈很有用。

ismail               hard    nofile          512

In this example we specify that the user ismail can only open 512 files or file descriptors with nofile item.

在此示例中,我们指定用户ismail只能打开512文件或带有nofile项的文件描述符。

限制登录数量 (Limit Number Of Logins)

By default a user can have infinite numbers of connections, sessions or logins in a system. This may create some security or performance problems for the systems. We can set some limits about this.

默认情况下,用户在系统中可以具有无限数量的连接,会话或登录名。 这可能会给系统带来一些安全性或性能问题。 我们可以对此设置一些限制。

@student        -       maxlogins       4

In this examples we limit student groups users login count. We use maxlogins for each users in student group. The maximum number of login can not be more than 4 .

在此示例中,我们限制student团体用户的登录次数。 我们为学生组中的每个用户使用maxlogins 。 登录的最大数量不能超过4

.u0bce243fd61b070506587d6817965522 , .u0bce243fd61b070506587d6817965522 .postImageUrl , .u0bce243fd61b070506587d6817965522 .centered-text-area { min-height: 80px; position: relative; } .u0bce243fd61b070506587d6817965522 , .u0bce243fd61b070506587d6817965522:hover , .u0bce243fd61b070506587d6817965522:visited , .u0bce243fd61b070506587d6817965522:active { border:0!important; } .u0bce243fd61b070506587d6817965522 .clearfix:after { content: ""; display: table; clear: both; } .u0bce243fd61b070506587d6817965522 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u0bce243fd61b070506587d6817965522:active , .u0bce243fd61b070506587d6817965522:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u0bce243fd61b070506587d6817965522 .centered-text-area { width: 100%; position: relative; } .u0bce243fd61b070506587d6817965522 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u0bce243fd61b070506587d6817965522 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u0bce243fd61b070506587d6817965522 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u0bce243fd61b070506587d6817965522:hover .ctaButton { background-color: #E67E22!important; } .u0bce243fd61b070506587d6817965522 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u0bce243fd61b070506587d6817965522 .u0bce243fd61b070506587d6817965522-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u0bce243fd61b070506587d6817965522:after { content: ""; display: block; clear: both; }

LEARN MORE  Best Tools To Monitor Linux

.u0bce243fd61b070506587d6817965522 , .u0bce243fd61b070506587d6817965522 .postImageUrl , .u0bce243fd61b070506587d6817965522 .centered-text-area { min-height: 80px; position: relative; } .u0bce243fd61b070506587d6817965522 , .u0bce243fd61b070506587d6817965522:hover , .u0bce243fd61b070506587d6817965522:visited , .u0bce243fd61b070506587d6817965522:active { border:0!important; } .u0bce243fd61b070506587d6817965522 .clearfix:after { content: ""; display: table; clear: both; } .u0bce243fd61b070506587d6817965522 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u0bce243fd61b070506587d6817965522:active , .u0bce243fd61b070506587d6817965522:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u0bce243fd61b070506587d6817965522 .centered-text-area { width: 100%; position: relative; } .u0bce243fd61b070506587d6817965522 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u0bce243fd61b070506587d6817965522 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u0bce243fd61b070506587d6817965522 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u0bce243fd61b070506587d6817965522:hover .ctaButton { background-color: #E67E22!important; } .u0bce243fd61b070506587d6817965522 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u0bce243fd61b070506587d6817965522 .u0bce243fd61b070506587d6817965522-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u0bce243fd61b070506587d6817965522:after { content: ""; display: block; clear: both; }

了解更多监视Linux的最佳工具

限制系统登录数(Limit Number Of System Logins)

In previous example we have restricted maximum logins as user base. we can also specify total number of logins in system wide. This restriction will be effective in general manner.

在前面的示例中,我们限制了最大登录名作为用户群。 我们还可以指定系统范围内的登录总数。 该限制将以一般方式生效。

*        -       maxsyslogins       40

In this example we restrict for all users and groups but actually this is not a user or group based restriction. We set this rule system wide and use maxsyslogin item as 40

在此示例中,我们限制所有用户和组,但实际上这不是基于用户或组的限制。 我们在整个系统范围内设置此规则,并将maxsyslogin项设置为40

限制最大文件大小 (Limit Maximum File Size)

We may want to restrict file size. This restriction can be useful in temp or similar usage type files.

我们可能要限制文件大小。 此限制在临时文件或类似用法类型文件中很有用。

@student        -       fsize       4000000

In this example we limit the students single file size as 4000000 . This is presentation of KB or kilobyte. So the example means 4 GB . We use fsize as item type.

在此示例中,我们将学生的单个文件大小限制为4000000 。 这是KB或千字节的表示。 因此该示例意味着4 GB 。 我们使用fsize作为项目类型。

翻译自: https://www.poftut.com/limits-conf-file-limit-users-process-linux-examples/

limits.conf文件

limits.conf文件_Limits.conf文件限制用户,在Linux中通过示例进行处理相关推荐

  1. Linux每个用户单独配置ssh,大神全面解读如何限制SSH用户访问Linux中指定的目录...

    将 SSH 用户会话限制访问到特定的目录内,特别是在 web 服务器上,这样做有多个原因,但最显而易见的是为了系统安全.为了锁定 SSH 用户在某个目录,我们可以使用 chroot 机制. 在诸如 L ...

  2. linux 修改用户dir,linux中dir命令详解

    在linux系统下dir命令的功能和ls命令差不多,主要是用以查看目录.文件权限等详细信息.下面由学习啦小编整理了linux中dir命令的详细解释,希望对你有帮助. linux中dir命令的详细解释 ...

  3. linux查看用户bashrc,Linux中.bashrc用户环境文件详解

    Linux中.bashrc用户环境文件影响用户使用bash,于是笔者来分析一下文件中重要的部分.看看文件中关于文件作用的说明: ~/.bashrc: executed by bash(1) for n ...

  4. linux wait函数头文件_第五十八章、linux中的3种正常结束进程的方式你都了解么...

    在前两章中我们了解了创建进程,这一章我们来了解下,在linux下怎么结束进程. 在linux中,有3种正常结束进程的方法和2种异常终止的方法: 1. 正常结束: a. 在main函数中调用return ...

  5. linux下删除的文件怎么恢复出厂设置,如何在Linux中恢复已删除的文件(机器翻译)...

    如果您在Linux中不小心删除了一个文件,不要担心,只要该区域的磁盘尚未被覆盖,您可能仍然可以恢复它.这篇文章将告诉你如何在Linux中轻松恢复被删除的文件. Foremost能够搜索磁盘或原始图像文 ...

  6. linux 回到用户主目录,linux中用户的主目录~

    -在linux中代表用户主目录 对一般用户,-表示/home/(用户名) 对于root用户,-表示/root 如果要查看-的真实面貌,可以先进入-目录,然后用pwd -P命令查看-的绝对路径 cd ~ ...

  7. linux 中切换用户指令,Linux中的Su命令(切换用户)

    su(替代或切换用户的缩写)实用程序允许您使用其他用户(默认情况下为root用户)的特权运行命令. 使用su是在当前登录会话中切换到管理帐户的最简单方法.当不允许root用户通过ssh或使用GUI显示 ...

  8. linux拷贝文件到多个目录,怎么在 Linux 中复制文件到多个目录中

    cp命令将文件复制到目录文件夹. 如果需要复制一个文件到多个文件夹下,可以使用多条cp语句,或者使用shell脚本. 用法示例: 复制abc.txt到ab cd ef目录下 $ cp abc.txt ...

  9. linux文件系统目录结构采用的是,在Linux中,文件系统的目录结构采用的是()。...

    在Linux中,文件系统的目录结构采用的是(). 更多相关问题 徒长枝属于以下哪种一年生枝条类别中的一种() 以下对得房率描述正确的是() 用拉伸试验的方法,可测定金属材料的(). 以下对得房率描述正 ...

  10. Linux中文件查找技术大全

    Linux中文件查找技术大全 转载出处:http://tech.sina.com.cn/c/2001-10-29/6739.html 文/Linuxdoor 每一种操作系统都是由成千上万个不同种类的文 ...

最新文章

  1. 苹果遭火速打脸:照片扫描AI被逆向工程,英特尔工程师发现漏洞
  2. 在linux系统中安装VSCode(Visual Studio Code)
  3. 初次使用PyCharm
  4. java sliplist_Java List retainAll()用法及代码示例
  5. Application log save debug - how log data is persisted to database table
  6. 数据结构 线性链表栈
  7. keyshot局部打光_keyshot7耳机渲染打光教程
  8. java写 excel
  9. Django restframework 嵌套关系处理
  10. matlab 正弦曲线平均值,正弦函数和余弦函数的平均值求解
  11. 数据库面试题SQL篇
  12. NB模块-QS100-默认demo
  13. iBatis数据库字段映射到Java对象。
  14. windows 序列号
  15. EDIUS设置字幕时注意事项
  16. 2.文件的打开及创建_open函数_creat函数
  17. Vuforia用在安卓设备中外接USB摄像头(一)
  18. 神经网络——MLP(多层感知机)和RBF(径向基函数神经网络)
  19. 个人计算机上的服务器怎么打开,电脑服务器怎么打开
  20. 中国信通院发布“2022人工智能十大关键词”

热门文章

  1. 2021计算机会议截稿时间,ICCV 2021即将截稿、NeurIPS 大会征稿通知... | AI 顶会动态一览...
  2. 岗位-iOS开发工程师-总结
  3. Fixing DSDT
  4. 【论文泛读171】具有对抗性扰动的自监督对比学习,用于鲁棒的预训练语言模型
  5. 第12篇:给任意java程序挂Socks5代理方法
  6. 恶意访问网站的策略处理,IP访问限制
  7. 小象学院—小象学院—Python学习联盟09—空气质量指数计算
  8. onclick和onfocus的区别
  9. 如何设置线程池参数?美团给出了一个让面试官虎躯一震的回答。
  10. 假装内卷,才是互联网人的骚操作