收紧炮弹对抗forkbomb

时间:2012-03-29 07:23:39

标签: linux security shell

我有一台服务器,我必须允许远程SSH用户出于某种目的。 我希望针对任何类型的fork bomb收紧shell 。我怎样才能做到这一点 ?我期待一种基于限制特定用户的CPU使用率的解决方案。

1 个答案:

答案 0 :(得分:6)

这就是你要找的东西

http://linux.die.net/man/5/limits.conf

您可以执行类似

的操作
@remote_user            hard    cpu             50
@remote_user            hard    nproc           50

从而限制了remote_user可以创建的CPU使用率和进程数。