limits.conf配置详解
2016-04-28 11:41
435 查看
limits.conf 文件实际是 Linux PAM(插入式认证模块,Pluggable Authentication Modules)中 pam_limits.so 的配置文件,而且只针对于单个会话。
limits.conf的格式如下:
username|@groupname type resource limit
username|@groupname:设置需要被限制的用户名,组名前面加@和用户名区别。也可以用通配符*来做所有用户的限制。
type:有 soft,hard 和 -,soft 指的是当前系统生效的设置值。hard 表明系统中所能设定的最大值。soft 的限制不能比har 限制高。用 - 就表明同时设置了 soft 和 hard 的值。
resource:
core - 限制内核文件的大小
date - 最大数据大小
fsize - 最大文件大小
memlock - 最大锁定内存地址空间
nofile - 打开文件的最大数目
rss - 最大持久设置大小
stack - 最大栈大小
cpu - 以分钟为单位的最多 CPU 时间
noproc - 进程的最大数目
as - 地址空间限制
maxlogins - 此用户允许登录的最大数目
要使 limits.conf 文件配置生效,必须要确保 pam_limits.so 文件被加入到启动文件中。查看 /etc/pam.d/login 文件中有:
session required /lib/security/pam_limits.so
例如:修改文件描述符大小(65536)
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
转载来源:http://kerry.blog.51cto.com/172631/300784
limits.conf的格式如下:
username|@groupname type resource limit
username|@groupname:设置需要被限制的用户名,组名前面加@和用户名区别。也可以用通配符*来做所有用户的限制。
type:有 soft,hard 和 -,soft 指的是当前系统生效的设置值。hard 表明系统中所能设定的最大值。soft 的限制不能比har 限制高。用 - 就表明同时设置了 soft 和 hard 的值。
resource:
core - 限制内核文件的大小
date - 最大数据大小
fsize - 最大文件大小
memlock - 最大锁定内存地址空间
nofile - 打开文件的最大数目
rss - 最大持久设置大小
stack - 最大栈大小
cpu - 以分钟为单位的最多 CPU 时间
noproc - 进程的最大数目
as - 地址空间限制
maxlogins - 此用户允许登录的最大数目
要使 limits.conf 文件配置生效,必须要确保 pam_limits.so 文件被加入到启动文件中。查看 /etc/pam.d/login 文件中有:
session required /lib/security/pam_limits.so
例如:修改文件描述符大小(65536)
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
转载来源:http://kerry.blog.51cto.com/172631/300784
相关文章推荐
- 优化或修改CentOS最大连接数限制
- Linux下ulimit和/etc/security/limits.conf的区别及使用注意
- Oracle安装:limits.conf 文件配置
- linux 作为java web服务器参数系统参数优化(调优)
- root无法登录ssh排查思路
- CentOS7修改单个进程可打开的最大文件句柄数
- linux limits.conf 配置
- vlc-android(1.9.1) 移到android studio
- 用dos命令实现导入、导出windows计划任务详解
- 自定义App头像背景圆框
- Material Design: NavigationView FlaotingActionBar SnackBar的使用,navigationview
- vtk实战(十六)——解析STL文件
- ZeroMQ研究与应用分析
- Caused by: android.content.res.Resources$NotFoundException: File res/drawable/main_tab_conversation_
- 目标检测“Exploit All the Layers: Fast and Accurate CNN Object Detector with Scale Dependent Pooling and”
- [openvc]4.创建一张图片并保存到本地
- php开启openssl的方法
- firstobjet free xml的格式化
- 磊科路由器动态获取IP模式下不显示DNS设置的问题
- 从java到初学javaweb,所遇问题