ulimit: limit maximum number of processes per user

- Limits the number of processes a user can start to 2000
  Mostly in place to prevent fork bombs taking down the host.
- If anyone encounters problems with this number we can raise it
This commit is contained in:
Rouven Seifert 2024-03-03 11:34:39 +01:00
parent 017a807a7c
commit d611cc5a26
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09

View file

@ -29,6 +29,15 @@
git
];
# prevent fork bombs
security.pam.loginLimits = [
{
domain = "@users";
item = "nproc";
type = "hard";
value = "2000";
}
];
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = "yes";