ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 在 linux 下修改用户的 limitation, (和用户的登录Shell相关)(转)

在 linux 下修改用户的 limitation, (和用户的登录Shell相关)(转)

原创 Linux操作系统 作者:post0 时间:2007-08-11 13:09:51 0 删除 编辑
在 linux 下修改用户的 limitation, (和用户的登录Shell相关)(转)[@more@]

在 Linux 下某用户下能否产生 core 文件,产生的 core file size 的等限制,是可以通过修改配置文件

/etc/security/limits.conf 文件里的配置来加以修改。有的时候,系统会在 /etc/profile 之类的文件中

作出全局的配置。例如: 在 SUSE 下的 /etc/profile 经常有如下的缺省设置:

ulimit -Sc 0 # don't create core files

ulimit -Sd $(ulimit -Hd)

ulimit -Ss $(ulimit -Hs)

ulimit -Sm $(ulimit -Hm)

如果希望产生 core,别忘了把这里的设置注释掉。

按照文件前部的说明,可以在文件中添加类似这样的行:

username soft core scorefilesize

username hard core hcorefilesize

或

@group soft core scorefilesize

@group hard core hcorefilesize

分别对用户'username'和组'groupname'设置能否产生 core,产生的 core file size 的限制

占位符scorefilesize和hcorefilesize需要分别填写

请详细阅读文件 /etc/security/limits.conf 的注释部分

# /etc/security/limits.conf

#

#Each line describes a limit for a user in the form:

#

#Where:

# can be:

# - an user name

# - a group name, with @group syntax

# - the wildcard *, for default entry

# - the wildcard %, can be also used with %group syntax,

# for maxlogin limit

#

# can have the two values:

# - "soft" for enforcing the soft limits

# - "hard" for enforcing hard limits

#

# can be one of the following:

# - 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

# - locks - max number of file locks the user can hold

#

#

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8225414/viewspace-945118/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    2018
  • 访问量
    8226644