Linux command
limits.conf 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Set maximum open files for user
[username] hard nofile [65535]
Set memory limit
[username] hard as [4194304]
Set for all users
* soft nproc [1024]
Set for group
@[groupname] hard maxlogins [10]
说明
limits.conf is a PAM configuration file that sets resource limits for users and groups. Limits are enforced when users log in through PAM-enabled services. The format is: domain type item value. Domain can be username, @groupname, or * for all users.
参数
- hard
- Hard limit (maximum value).
- soft
- Soft limit (default value).
- nofile
- Maximum open files.
- nproc
- Maximum processes.
- as
- Address space limit.
- maxlogins
- Maximum logins.
- memlock
- Maximum locked memory.
- stack
- Maximum stack size.
FAQ
What is the limits.conf command used for?
limits.conf is a PAM configuration file that sets resource limits for users and groups. Limits are enforced when users log in through PAM-enabled services. The format is: domain type item value. Domain can be username, @groupname, or * for all users.
How do I run a basic limits.conf example?
Run `[username] hard nofile [65535]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does hard do in limits.conf?
Hard limit (maximum value).