Re: memory limit/quota per user

Alex Brandt <[email protected]> Fri, 18 Jun 2010 09:34:20 -0500
Newsgroups org.kernel.vger.linux-admin
Message-ID <[email protected]>
On Tuesday 08 June 2010 5:32:46 am Tharindu Rukshan Bamunuarachchi wrote:
> Hello All,
> 
> Is it possible to limit memory quota per user (like disk quota) in 
linux ?
> 
> AFAIK, RLIMIT_* (i.e. RSS, DATA) are applicable per process not per 
user.
> 
> thankx a lot.
> tharindu.
> 
> 
> "those that can, do. Those that can’t, complain." -- Linus
> --
> To unsubscribe from this list: send the line "unsubscribe linux-admin" 
in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

You can use the pam security limits feature.

Simply check that the module is being loaded in pam.d:

/etc/pam.d/system-auth:session          required        pam_limits.so 

Then use the /etc/security/limits.conf file:
<user> soft|hard memlock <value>

Regards,

Alex Brandt

-- 
Linux Administrator
http://www.alunduil.com
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)

iEYEABECAAYFAkwbg/EACgkQvpZ9jByxpSc3iQCfR6aJ1Q9oxLwtzU/muXPnNakk
byMAnjqbD8TGE3I+eeqepoRoWBKq3YD6
=/lIX
-----END PGP SIGNATURE-----