zoukankan      html  css  js  c++  java
  • Centos7修改了最大文件打开数不生效

    在limit.conf配置文件中添加了如下配置

    * soft nproc 65535
    * hard nproc 65535
    * soft nofile 131070
    * hard nofile 131070

    另启终端查看最大文件打开数ulimit -n仍然为1024

    经过各种百度搜查,发现以前更新过openssl和openssh,导致/etc/pam.d/sshd模块丢失,当sshd_config设置UsePAM yes的时候,无法ssh,我们现在添加sshd配置

    [root@k8s-master idcs]# cat /etc/pam.d/sshd
    #%PAM-1.0
    auth       required    pam_sepermit.so
    auth       substack     password-auth
    auth       include      postlogin
    # Used with polkit to reauthorize users in remote sessions
    -auth      optional     pam_reauthorize.so prepare
    account    required     pam_nologin.so
    account    include      password-auth
    password   include      password-auth
    # pam_selinux.so close should be the first session rule
    session    required     pam_selinux.so close
    session    required     pam_loginuid.so
    # pam_selinux.so open should only be followed by sessions to be executed in the user context
    session    required     pam_selinux.so open env_params
    session    required     pam_namespace.so
    session    optional     pam_keyinit.so force revoke
    session    include      password-auth
    session    include      postlogin
    # Used with polkit to reauthorize users in remote sessions
    -session   optional     pam_reauthorize.so prepare

    然后重启sshd并另启终端查看最大文件打开数(生效了)

    [root@k8s-master idcs]# systemctl restart sshd
    [root@k8s-master idcs]# ulimit -n
    131070
  • 相关阅读:
    Python装饰器理解(新手)
    vue项目随笔
    ajax 请求数据传到后台为空字符
    关于document.body.scrollTop 的谷歌,火狐浏览器兼容问题
    Nginx 反向代理解决浏览器跨域问题
    SpringBoot maven build a new demo
    UI收集
    git
    编译
    网络2
  • 原文地址:https://www.cnblogs.com/cpw6/p/13186736.html
Copyright © 2011-2022 走看看