亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 768 | 回復: 0
打印 上一主題 下一主題

Red Hat 下如何限制用戶或者組的系統(tǒng)資源使用 [復制鏈接]

論壇徽章:
0
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2003-06-25 15:20 |只看該作者 |倒序瀏覽
#首次發(fā)布于www.linuxsir.com
# 本人整理翻譯自pam-6.html

在Linux中通過PAM的一個模塊:pam_limits 可以非常簡單的實現(xiàn)對某些用戶,或者組的系統(tǒng)資源使用限制,甚至不用重啟機器.

下面我們先看看這個模塊的說明:
模塊名稱:

pam_limits

作者:

Cristian Gafton <gafton@redhat.com>;

Elliot Lee <sopwith@redhat.com>; 貢獻了很多注釋

維護者:

Cristian Gafton - 1996/11/20

Management groups provided:

session

系統(tǒng)倚賴:

需要一個 /etc/security/limits.conf 文件 和內(nèi)核對資源限制的支持,同時也需要使用 libpwdb 庫

接收的參數(shù):

debug; conf=/path/to/file.conf

描述:

通過讀取配置文件: /etc/security/limits.conf, 能夠對用戶的session進行資源限制. 但是uid=0的用戶的資源不進行限制 .

通過以下參數(shù)可以修改這個模塊的屬性:

* debug - verbose logging to syslog(3).
* conf=/path/to/file.conf - indicate an alternative limits configuration file to the default.
* change_uid - change real uid to the user for who the limits are set up. Use this option if you have problems like login not forking a shell for user who has no processes. Be warned that something else may break when you do this.

建議使用方法:

首先應該有個一個僅root用戶能讀的文件 (默認是 /etc/security/limits.conf). 這個文件定義了限制的規(guī)則.

每行都定義了一個針對用戶或組的限制


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

<domain>; 應該是:

* 一個用戶名
* 一個組名,格式如下 @group
* 匹配模式 "*", 給默認的設置

<type>; 可以有三個值:

* hard for enforcing hard resource limits. 這些限制由超級用戶設置,內(nèi)核負責強制執(zhí)行.用戶無法改變他們對系統(tǒng)資源的最高使用限額 .
* soft for enforcing soft resource limits. These limits are ones that the user can move up or down within the permitted range by any pre-exisiting hard limits. The values specified with this token can be thought of as default values, for normal system usage.
* - for enforcing both soft and hard limits together.

<item>; 可以是如下:

* core - limits the core file size (KB)
* data - max data size (KB)
* fsize - maximum filesize (KB)
* memlock - max locked-in-memory address space (KB)
* nofile - max number of open files
* rss - max resident set size (KB)
* stack - max stack size (KB)
* cpu - max CPU time (MIN)
* nproc - max number of processes
* as - address space limit
* maxlogins - max number of logins for this user.
* priority - the priority to run user process with

這些限制是基于每個LOGIN 的,而并非全局的設置.

示例文件:

# EXAMPLE /etc/security/limits.conf file:
# =======================================
# <domain>; <type>; <item>; <value>;
* soft core 0
* hard rss 10000
@student hard nproc 20
@faculty soft nproc 20
@faculty hard nproc 50
ftp hard nproc 0
@student - maxlogins 4

然后再來看看我們系統(tǒng)中哪里使用了這個模塊.
[cat /etc/pam.d/syatem-auth]

如果你看到這行:
session required /lib/security/$ISA/pam_limits.so

那么說明你的系統(tǒng)已經(jīng)可以使用這個限制的機制了.
你所要做的僅僅是修改/etc/security/limits.conf 文件.
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP