From ee55630dcb85b065ac73fe34bb9db93117054648 Mon Sep 17 00:00:00 2001 From: weiliang <1067599390@qq.com> Date: Thu, 26 Oct 2023 13:34:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...53\345\242\231\347\233\270\345\205\263.md" | 1 - ...66\346\211\223\345\274\200\346\225\260.md" | 35 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 "1.Linux\345\237\272\347\241\200/1.3\347\263\273\347\273\237\350\256\276\347\275\256/11\346\226\207\344\273\266\346\211\223\345\274\200\346\225\260.md" diff --git "a/1.Linux\345\237\272\347\241\200/1.1\345\270\270\347\224\250shell/\351\230\262\347\201\253\345\242\231\347\233\270\345\205\263.md" "b/1.Linux\345\237\272\347\241\200/1.1\345\270\270\347\224\250shell/\351\230\262\347\201\253\345\242\231\347\233\270\345\205\263.md" index 9d849f55..2d46d68b 100644 --- "a/1.Linux\345\237\272\347\241\200/1.1\345\270\270\347\224\250shell/\351\230\262\347\201\253\345\242\231\347\233\270\345\205\263.md" +++ "b/1.Linux\345\237\272\347\241\200/1.1\345\270\270\347\224\250shell/\351\230\262\347\201\253\345\242\231\347\233\270\345\205\263.md" @@ -44,5 +44,4 @@ iptables -t raw -F iptables -t raw -X iptables -t raw -P PREROUTING ACCEPT iptables -t raw -P OUTPUT ACCEPT - ``` \ No newline at end of file diff --git "a/1.Linux\345\237\272\347\241\200/1.3\347\263\273\347\273\237\350\256\276\347\275\256/11\346\226\207\344\273\266\346\211\223\345\274\200\346\225\260.md" "b/1.Linux\345\237\272\347\241\200/1.3\347\263\273\347\273\237\350\256\276\347\275\256/11\346\226\207\344\273\266\346\211\223\345\274\200\346\225\260.md" new file mode 100644 index 00000000..fb6a2cc5 --- /dev/null +++ "b/1.Linux\345\237\272\347\241\200/1.3\347\263\273\347\273\237\350\256\276\347\275\256/11\346\226\207\344\273\266\346\211\223\345\274\200\346\225\260.md" @@ -0,0 +1,35 @@ +## ulimit + +### PAM模块 + +ssh 开启 pam 模块后应修改以下文件 + +- /etc/pam.d/su +- /etc/pam.d/sshd +- /etc/pam.d/login +- /etc/pam.d/cron + +添加如下内容 + +```shell +session required pam_limits.so +``` + +重启生效 + +```shell +systemctl restart sshd +``` + +修改`/etc/security/limits.conf`文件,用户列不能用`*`号,否则`root`登录后执行`ulimit -n` 值不对 + +```shell +root soft nofile 1048567 +root hard nofile 1048567 +root soft nproc 65535 +root hard nproc 65535 +``` + +```shell +NOTE: group and wildcard limits are not applied to the root user. To set a limit for the root user, this field must contain the literal username root. +``` \ No newline at end of file