-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfd8936
commit ee55630
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,5 +44,4 @@ iptables -t raw -F | |
iptables -t raw -X | ||
iptables -t raw -P PREROUTING ACCEPT | ||
iptables -t raw -P OUTPUT ACCEPT | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
``` |