今天遇到root账户登录不了的情况,很是郁闷,即使单用户修改了root密码也不能登录。

所以就特意看了一下/etc/security/limits.conf,发现是下面这样的。感觉呗坑了许久。(标红线的方框内)

都是-1;我理解是不允许root用户开启线程,打开文件之类的。

=================================================================================================================

通过ulimit -n命令可以查看Linux系统里打开文件描述符的最大值,一般缺省值是1024,对一台繁忙的服务器来说,这个值偏小,所以有必要重新设置linux系统里打开文件描述符的最大值。那么应该在哪里设置呢?

最正确的做法是在/etc/security/limits.conf里设置:
[root@localhost security]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 30518
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[root@localhost security]# ulimit -n 10240
[root@localhost security]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 30518
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 10240
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[root@localhost security]1. 命令用法

解除 Linux 系统的最大进程数和最大文件打开数限制:
        vi /etc/security/limits.conf
        # 添加如下的行
        * soft noproc 11000
        * hard noproc 11000
        * soft nofile 4100
        * hard nofile 4100 
       说明:* 代表针对所有用户
            noproc 是代表最大进程数
            nofile 是代表最大文件打开数

/etc/security/limits.conf的相关说明的更多相关文章

  1. linux /etc/security/limits.conf的相关说明

    暂时粘贴他人的地址,后续会整理后放出. 原文地址:http://blog.csdn.net/taijianyu/article/details/5976319

  2. CentOS6.x 下 /etc/security/limits.conf 被改错的故障经历

    Intro 我司本小厂,每个员工都是身兼数职,所以开发人员直接登录线上服务器改东西是常态.有些开发人员,自持水平较高(的确水平也是较高,但缺乏对系统的敬畏),所以总是越俎代庖,改一些本身应该是线上运维 ...

  3. 理解RHEL上安装oracle的配置参数 :/etc/security/limits.conf, /etc/profile, /etc/pam.d/login

    无论安装什么版本的Oracle,在安装之前,都需要配置 /etc/pam.d/login   /etc/profile   /etc/security/limits.conf这三个文件 那这三个文件究 ...

  4. linux /proc/sys/fs/file-nr /proc/sys/fs/file-max /etc/security/limits.conf 三者的关联

    ulimit -n 对应 /etc/security/limits.conf 文件设置 问题: Can’t open so many files 对于linux运维的同学们,相信都遇到过这个问题. 在 ...

  5. linux资源使用配置文件 /etc/security/limits.conf和ulimit

    limits.conf文件实际上是linux PAM中pam_limits.so的配置文件,而且只针对于单个会话. limits.conf的格式如下: <domain> <type& ...

  6. /etc/security/limits.conf 设置

    jrhdpt01:/root# cat /etc/security/limits.conf  * soft nofile 65535  * hard nofile 65535  * soft npro ...

  7. /etc/security/limits.conf 文件说明

    /etc/security/limits.conf 是 Linux 资源使用配置文件,用来限制用户对系统资源的使用 语法:<domain>  <type>  <item& ...

  8. [转帖]/etc/security/limits.conf的含义

    https://www.cnblogs.com/pzk7788/p/7250723.html /etc/security/limits.conf 是 Linux 资源使用配置文件,用来限制用户对系统资 ...

  9. too many open file /etc/security/limits.conf

      当出现too mang open file 时更改/etc/profile中的ulimit -n 65536 ,查看   然后ssh进去,或者退出之后重新登录使之生效                ...

随机推荐

  1. ID 生成器 雪花算法

    https://blog.csdn.net/wangming520liwei/article/details/80843248 ID 生成器 雪花算法 2018年06月28日 14:58:43 wan ...

  2. 多线程、互斥锁、异步、GIL

    多线程-threading python的thread模块是比较底层的模块,python的threading模块是对thread做了一些包装的,可以更加方便被使用 from threading imp ...

  3. 学习笔记之English

    雅思听力地图题的常用短语 - 无忧机经预测 https://mp.weixin.qq.com/s/VmV3L2METymtjMWHY2fNiA 雅思听力租房的那些事儿 - 北京市海淀区环球雅思 htt ...

  4. Promise.all处理多个异步请求

    一个前台页面需要请求2个rest接口获取数据,一个用于解析文件获取列名,一个查询数据库获得列值. 有很低的概率页面显示为空,刷新可能就有显示了. 使用Promise.all就解决了上面的问题,2部分数 ...

  5. python css选择器

    css 选择器 <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...

  6. es6入门总结

    let和const命令 let命令 循环体的let变量只对花括号作用域可见,花括号外不可见 循环体的语句部分是一个父作用域,而循环体内部是一个单独的子作用域 let声明的变量不存在变量提升,未声明的使 ...

  7. jenkins部署web项目(不包含前后端分离)

    本次部署的是非常非常传统的web项目, jsp页面那种, 一 首先给tomact设置管理员用户和管理员密码,这类的教程网上有很多,在<tomcat-users><tomcat-use ...

  8. BootStrap table动态增删改表格内数据

    1:添加一个[操作]列   { title: "操作", align: 'center', valign: 'middle', width: 160, // 定义列的宽度,单位为像 ...

  9. http(数据格式)、postman(数组、id、断言) 小知识必看啊

  10. 逆向工程vgenerator(一)

    前言 想要自己实现一个mybatis-generator类似的轮子,目前只实现MySQL部分的方法.利用下班时间,写了一个小项目,实现了这个功能.我准备分成三篇博客来写这个东西. 基类 /** *基类 ...