Skip to content

Commit

Permalink
更新文档内容
Browse files Browse the repository at this point in the history
  • Loading branch information
weiliang-ms committed Oct 26, 2023
1 parent dfd8936 commit ee55630
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
1 change: 0 additions & 1 deletion 1.Linux基础/1.1常用shell/防火墙相关.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,4 @@ iptables -t raw -F
iptables -t raw -X
iptables -t raw -P PREROUTING ACCEPT
iptables -t raw -P OUTPUT ACCEPT

```
35 changes: 35 additions & 0 deletions 1.Linux基础/1.3系统设置/11文件打开数.md
Original file line number Diff line number Diff line change
@@ -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.
```

0 comments on commit ee55630

Please sign in to comment.