在Debian服务器上配置安全限制
时间:2020-03-21 11:43:03 来源:igfitidea点击:
这些是我通常用作Debian LAMP服务器起点的安全限制。
打开/etc/security/limits.conf
进行编辑和设置限制。
请注意,建议避免更改任何已设置为比下面列出的数字更大的值。
# 2048 is a fair number * soft nofile 2048 * hard nofile 65536 * soft nproc 2048 * hard nproc 16384 * soft locks 2048 * hard locks 2048 * soft stack 10240 * hard stack 32768 * - maxlogins 50 # Soft limit 32GB, hard 64GB * soft fsize 33554432 * hard fsize 67108864 # Disable core dumps for all users * hard core 0 # Defaults * soft memlock 64 * hard memlock 64 # Limits for root root soft nofile 2048 root hard nofile 65536 root soft nproc 2048 root hard nproc 16384 root soft stack 10240 root hard stack 32768 root soft fsize 33554432
保存文件后,您需要注销并再次登录以使更改生效。