Se protéger des fork Bomb

Fermé
kevin76110 Messages postés 4273 Date d'inscription vendredi 14 août 2009 Statut Membre Dernière intervention 27 mars 2013 - 30 nov. 2010 à 01:35
zipe31 Messages postés 36402 Date d'inscription dimanche 7 novembre 2010 Statut Contributeur Dernière intervention 27 janvier 2021 - 7 déc. 2010 à 17:27
Bonjour,

Je cherche à me protéger des fork bomb.
J'ai trouvé ceci :

http://doc.ubuntu-fr.org/tutoriel/comment_se_proteger_des_fork_bomb

Seulement, lorsque j'édite limits.conf, rien ne se passe ( ulimit -u me renvoie unlimited).
Bon ... J'ai l'habitude que rien ne fonctionne du premier coup ...

Je case session required /lib/security/pam_limits.so

dans

*
/etc/pam.d/common-session
*
/etc/pam.d/login
*
/etc/pam.d/su
*
/etc/pam.d/xdm
*
/etc/pam.d/gdm
*
/etc/pam.d/sshd

Ainsi que UsePAM yes


Je redémarre le PC, et là je tape ulimit -u, le PC me renvoie unlimited au lieu de 100.

Quelqu'un pourrait m'aider à me protéger des fork bomb ? Ou me dire ce que j'ai loupé dans ma manip' ?

Merci d'avance,

Kévin.



A voir également:

4 réponses

kevin76110 Messages postés 4273 Date d'inscription vendredi 14 août 2009 Statut Membre Dernière intervention 27 mars 2013 872
7 déc. 2010 à 02:43
Le voici :

# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
# - NOTE: group and wildcard limits are not applied to root.
# To apply a limit to the root user, <domain> must be
# the literal username root.
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit (KB)
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to values: [-20, 19]
# - rtprio - max realtime priority
# - chroot - change root to directory (Debian-specific)
#
#<domain> <type> <item> <value>
#

#* soft core 0
#root hard core 100000
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#ftp - chroot /ftp
#@student - maxlogins 4
#* hard nproc 100
# End of file
1
zipe31 Messages postés 36402 Date d'inscription dimanche 7 novembre 2010 Statut Contributeur Dernière intervention 27 janvier 2021 6 407
7 déc. 2010 à 07:54
Salut,

En décommentant la ligne ça devrait le faire on ne peut mieux ;-\

#* soft core 0
#root hard core 100000
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#ftp - chroot /ftp
#@student - maxlogins 4
* hard nproc 100
# End of file 
0
kevin76110 Messages postés 4273 Date d'inscription vendredi 14 août 2009 Statut Membre Dernière intervention 27 mars 2013 872
7 déc. 2010 à 17:07
Pourquoi on retire le # ?
0
zipe31 Messages postés 36402 Date d'inscription dimanche 7 novembre 2010 Statut Contributeur Dernière intervention 27 janvier 2021 6 407
7 déc. 2010 à 17:27
Parce que sinon ce n'est pas pris en compte !
C'est le principe même des dièses (#) qui servent à commenter les lignes afin d'y apposer un commentaire ou d'empêcher une ligne d'être prise en compte ;-))
0
stajem Messages postés 371 Date d'inscription jeudi 23 août 2007 Statut Membre Dernière intervention 20 juin 2011 79
30 nov. 2010 à 23:11
Je te donne ce lien qui me semble très intéressant et complet. Si ça ne suffit pas, hésite pas à revenir ici. Je suis le post.
Sujet très intéressant.

http://xhanch.com/web-server-limit-resource-usage-per-user-via-limits-conf/
0
kevin76110 Messages postés 4273 Date d'inscription vendredi 14 août 2009 Statut Membre Dernière intervention 27 mars 2013 872
2 déc. 2010 à 16:14
J'essaie ce soir ...
0
stajem Messages postés 371 Date d'inscription jeudi 23 août 2007 Statut Membre Dernière intervention 20 juin 2011 79
6 déc. 2010 à 18:09
alors ? quoi de neuf ?
0
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 472
6 déc. 2010 à 19:37
Bonjour,

Le plus simple aurait été de copier-coller ici ton fichier

/etc/security/limits.conf

0