LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Is there something like memory and CPU quota? (https://www.linuxquestions.org/questions/linux-security-4/is-there-something-like-memory-and-cpu-quota-535220/)

cyberfishee 03-06-2007 07:45 PM

Is there something like memory and CPU quota?
 
Hi,
I was wondering, is there any way to stop untrusted local users from running something like:

Code:

while(1) {
    malloc(1);
}

to bring down the whole system? (eg. some sort of memory quota?)

I tried it on my Debian box with a Core 2 Duo E6300 and 1GB ram from an unprivileged user, and it completely crashed my system within seconds if not shorter.

Is there something conceptual that I am missing here? (eg. should untrusted users not be allowed to run any binary? That doesn't seem practical in eg, a school setting)

Thank you very much
Matthew Lai

macemoneta 03-06-2007 11:10 PM

The 'ulimit' command (part of the bash shell; man ulimit) or /etc/security/limits.conf (part of pam, man limits.conf) will do the job.

cyberfishee 03-06-2007 11:28 PM

wow!
I just looked it up.
It is amazing.

Strange that I have never heard of it, being an alomst 4 years Linux user.

Thank you =)


All times are GMT -5. The time now is 10:23 AM.