Linux用戶資源管理限制
时间:2006-11-08 来源:kinux
http://gentoo-wiki.com/SECURITY_Limit_User_Processes
SECURITY Limit User Processes
|
Introduction
Limiting user processes is one way to make sure that one user can not "commandeer" the system making it unusable for others. To limit the processes a user on your system can we have two files to edit
/etc/limits owned by the sys-apps/shadow package /etc/security/limits.conf owned the the sys-libs/pam package : This only affects programs affected by PAM, so the pam USE flag should be set./etc/limits
File format
Each line consists of username followed by a limit string. The limit string describes limits for particular user. The options are:
- A: max address space (KB)
- C: max core file size (KB)
- D: max data size (KB)
- F: maximum filesize (KB)
- M: max locked-in-memory address space (KB)
- N: max number of open files
- R: max resident set size (KB)
- S: max stack size (KB)
- T: max CPU time (MIN)
- U: max number of processes
- L: max number of logins for this user
- : file creation mask, set by umask
- : process priority, set by setpriority
Example
File: /etc/limits |
# This will limit all users to 40 processes max. This can be used to prevent a "fork bomb". |
相关阅读 更多 +