<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Debian or not to be ? 2.0 &#187; linux</title> <atom:link href="http://www.crashdump.fr/tag/linux/feed/" rel="self" type="application/rss+xml" /><link>http://www.crashdump.fr</link> <description>that is the question</description> <lastBuildDate>Mon, 23 Jan 2012 13:14:39 +0000</lastBuildDate> <language>fr</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator> <item><title>Effacer définitivement les données d&#8217;un disque dur sous *nux (dd, zero, random)</title><link>http://www.crashdump.fr/debian/effacer-definivement-toutes-les-donnees-dun-disque-dur-sous-nux-677/</link> <comments>http://www.crashdump.fr/debian/effacer-definivement-toutes-les-donnees-dun-disque-dur-sous-nux-677/#comments</comments> <pubDate>Tue, 05 May 2009 20:25:48 +0000</pubDate> <dc:creator>Crashdump</dc:creator> <category><![CDATA[Debian]]></category> <category><![CDATA[Sécurité]]></category> <category><![CDATA[bsd]]></category> <category><![CDATA[dd]]></category> <category><![CDATA[disque dur]]></category> <category><![CDATA[fichier]]></category> <category><![CDATA[format]]></category> <category><![CDATA[formater]]></category> <category><![CDATA[hexdump]]></category> <category><![CDATA[kernel]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[os x]]></category> <category><![CDATA[partition]]></category> <category><![CDATA[Peter Gutmann]]></category> <category><![CDATA[secure]]></category> <category><![CDATA[securisé]]></category><guid isPermaLink="false">http://www.crashdump.fr/?p=677</guid> <description><![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2009/05/hard-disk-drive.png" class="attachment-featured-image wp-post-image" alt="hard-disk-drive" title="hard-disk-drive" /></p><br />Ce billet contient deux parties : la première explique succinctement les solutions et commandes pour pouvoir effacer toutes les données d&#8217;un disque (ou d&#8217;une partition). La deuxième approfondit les commandes et outils utilisés dans la première &#8212; Je me rend bien compte, après relecture du fait que j&#8217;ai pas mal dérivé dans l&#8217;écriture de cet article, [...]]]></description> <content:encoded><![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2009/05/hard-disk-drive.png" class="attachment-featured-image wp-post-image" alt="hard-disk-drive" title="hard-disk-drive" /></p><br /><p><em>Ce billet contient deux parties : <strong>la première explique succinctement les solutions et commandes</strong> pour pouvoir effacer toutes les données d&#8217;un disque (ou d&#8217;une partition). <strong>La deuxième approfondit les commandes et outils utilisés</strong> dans la première &#8212; Je me rend bien compte, après relecture du fait que j&#8217;ai pas mal dérivé dans l&#8217;écriture de cet article, il faut croire que j&#8217;avais beaucoup à dire.. donc si vous avez le temps, servez vous un café et profitez en bien.</em></p><p>Update le 6 Mai 2009: Correction des fautes d&#8217;orthographe&#8230;</p><p><strong>ATTENTION: Toutes les procédures ci-dessous sont définitives et non réversibles. Après avoir exécuté ces commandes, vous (ou un tiers) ne pourrez JAMAIS récupérer les informations qui y étaient stockées.</strong></p><p><em>Info: Dans ce billet j&#8217;utiliserais comme chemin pour mon disque dur a effacer : /dev/sdX, il vous faudra naturellement le remplacer par le vôtre. Vérifiez toujours d&#8217;abord vôtre table de partition avec &laquo;&nbsp;df&nbsp;&raquo; (utilitaire sans risques, il permet simplement de lister les disques montés sur vôtre système &#8211; NDLR : fstab)</em><br /> <em>Suivant la distribution *nix que vous utiliserez vous ne pourrez sûrement pas directement réinitialiser le disque système : il vous faudra utiliser un &laquo;&nbsp;live CD&nbsp;&raquo; ou booter sur un autre disque dur.</em></p><h2>1. L&#8217;utilitaire &laquo;&nbsp;dd&nbsp;&raquo;:</h2><p>L&#8217;utilitaire &laquo;&nbsp;dd&nbsp;&raquo; fourni avec tous les *nix et dérivés, permet de faire de nombreuses manipulations sur des fichiers ou des systèmes de fichiers comme (liste non exhaustive): Formatter une disquette à partir d&#8217;une image, découper un fichier en plusieurs morceaux, faire une image d&#8217;un DVD ou encore — et c&#8217;est ce qui nous intéresse ici — détruire les données d&#8217;un disque dur en le remplissant de zéros ou de données aléatoires.</p><p><strong>Il faut toujours faire attention lorsqu&#8217;on utilise dd. Le simple fait d&#8217;oublier une option ou d&#8217;échanger les arguments aura des conséquences désastreuses.</strong></p><h3>1.1 Méthode rapide et peu sûre :</h3><p>La première méthode consiste à écrire des 0 sur tous les secteurs du disque en une seule passe :</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdX <span style="color: #007800;">bs</span>=<span style="color: #000000;">512</span> <span style="color: #007800;">conv</span>=notrunc</div></td></tr></tbody></table></div><p><em>L&#8217;argument « conv=notrunc » permet de ne pas limiter la taille du fichier de sortie.</em></p><h3>1.2 Méthode lente et moyennement sûre :</h3><p>La seconde méthode, un peu plus sûre que la précédente consiste en l&#8217;utilisation du périphérique générateur d&#8217;aléatoires du noyau. Ce qui aura pour effet d&#8217;écrire des données aléatoires sur tous les secteurs du disque :</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dd if=/dev/urandom of=/dev/sdX bs=512 conv=notrunc</div></td></tr></tbody></table></div><h3>1.3 Méthode très lente et sûre:</h3><p>Ici nous allons utiliser la première méthode, mais avec 32 passe.. De quoi vraiment tout effacer.</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">for</span> n <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">seq</span> <span style="color: #000000;">32</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdX <span style="color: #007800;">bs</span>=<span style="color: #000000;">512</span> <span style="color: #007800;">conv</span>=notrunc; <span style="color: #000000; font-weight: bold;">done</span></div></td></tr></tbody></table></div><p>Notez qu&#8217;ici j&#8217;ai défini le paramètre « BS » qui correspond au nombre d&#8217;octets spécifié écrit en une seule fois. Ce qui permet de raccourcir considérablement le temps de chaque passe.</p><h3>1.4 Méthode vraiment très lente et très sûre:</h3><p>Pour cette dernière solution, vous l&#8217;aurez déduit par vous même, 16 passes de random, de quoi effacer définitivement n&#8217;importe quel octet sensible ! Suivant la taille du disque/partition, cette solution peut prendre énormément de temps&#8230;</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">for n in `seq 16`; do dd if=/dev/urandom of=/dev/sdX bs=512 conv=notrunc; done</div></td></tr></tbody></table></div><h2>Approfondissements :</h2><h3>Temps des opérations — Optimisations</h3><p>Voyons comment se comporte dd pour un fichier test de 100Mb avec notre solution n°1 et un Block size de 1:</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">bs</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">conv</span>=notrunc <span style="color: #007800;">count</span>=<span style="color: #000000;">102400000</span><br /> <span style="color: #000000;">102400000</span>+<span style="color: #000000;">0</span> records <span style="color: #000000; font-weight: bold;">in</span><br /> <span style="color: #000000;">102400000</span>+<span style="color: #000000;">0</span> records out<br /> <span style="color: #000000;">102400000</span> bytes transferred <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">458.989378</span> secs <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">223099</span> bytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#41;</span><br /> real 7m38.997s<br /> user 1m52.333s<br /> sys 5m30.299s</div></td></tr></tbody></table></div><p>1 * 102400000 = 100Mb, dd a mis environ 7 minutes 38 secondes, pitoyable, pourquoi ?!</p><p><strong>Petites précisions indispensables au sujet des secteurs (ou blocs)</strong>:<br /> Un secteur (ou bloc) est une subdivision d&#8217;une piste de votre disque dur. Chaque secteur peut stocker un nombre bien défini de données — les disques magnétiques fournissent généralement un espace de 512 octets (ce n&#8217;est pas le cas des SSD). La notion de bloc a été utilisée au début de l&#8217;informatique pour ce petit morceau de données, mais le terme secteur est devenu beaucoup plus courant. Puis peu à peu, « bloc » est devenu plus employé pour définir un certain nombre de données (variable) utilisé par un processus. Par exemple, le programme dd qui permet de définir la taille de bloc à utiliser lors de l&#8217;exécution avec le paramètre BS (= octets). En réalité, ça ne change pas la taille du secteur d&#8217;un support, seule la taille des données qui seront manipulées.</p><p><em>Notez que pour un CD, la taille d’un secteur est de 2.048 bytes (par exemple, si vous avez besoin de créer une image iso, tapez : dd if=/dev/hdc of=/tmp/mycd.iso bs=2048 conv=notrunc).</em></p><p>Reprenons — comment puis-je vérifier la taille des blocs sur un BSD ?</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ pdisk <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rdisk1 <span style="color: #660033;">-blockSize</span><br /> <span style="color: #000000;">512</span></div></td></tr></tbody></table></div><p>Et sur un GNU/Linux ?</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tune2fs <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md1 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> Block<br /> Block count: <span style="color: #000000;">5118688</span><br /> Block size: <span style="color: #000000;">4096</span><br /> Blocks per group: <span style="color: #000000;">32768</span></div></td></tr></tbody></table></div><p>Notez que sur le deuxième exemple, le système de fichier est en fait monté sur un RAID, d&#8217;où la réponse de BS de 4k.</p><p>Bien, maintenant que nous savons, essayons en spécifiant un BS de 512:</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">bs</span>=<span style="color: #000000;">512</span> <span style="color: #007800;">conv</span>=notrunc <span style="color: #007800;">count</span>=<span style="color: #000000;">200000</span><br /> <span style="color: #000000;">200000</span>+<span style="color: #000000;">0</span> records <span style="color: #000000; font-weight: bold;">in</span><br /> <span style="color: #000000;">200000</span>+<span style="color: #000000;">0</span> records out<br /> <span style="color: #000000;">102400000</span> bytes transferred <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">1.615840</span> secs <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">63372613</span> bytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#41;</span><br /> real 0m1.618s<br /> user 0m0.240s<br /> sys 0m1.015s</div></td></tr></tbody></table></div><p>512 * 200000 = 100Mb, dd a mis à peine plus d&#8217;une 2,4s (contre 7m38) — la différence est énorme, pourquoi ?</p><p>En fait, l&#8217;explication est simple, c&#8217;est la synchronisation entre les données envoyées et les données écrites. Des blocs de 512 octets sont envoyés au disque et sont directement écrits sur les secteurs correspondants ; inutile de mettre en cache 512 fois 1 octet pour pouvoir écrire notre bloc. Et si on spécifie un BS supérieur, me direz-vous ? Essayons.</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">time</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">bs</span>=<span style="color: #000000;">1024</span> <span style="color: #007800;">conv</span>=notrunc <span style="color: #007800;">count</span>=<span style="color: #000000;">100000</span><br /> <span style="color: #000000;">100000</span>+<span style="color: #000000;">0</span> records <span style="color: #000000; font-weight: bold;">in</span><br /> <span style="color: #000000;">100000</span>+<span style="color: #000000;">0</span> records out<br /> <span style="color: #000000;">102400000</span> bytes transferred <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">3.185333</span> secs <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">32147345</span> bytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#41;</span><br /> real 0m3.188s<br /> user 0m0.131s<br /> sys 0m0.693s</div></td></tr></tbody></table></div><p>En effet, cela ne nous apporte rien ! <strong>notez que j&#8217;ai spécifié bs=512, mais en fait dd utilise par défaut le block size de 512.</strong></p><h3>/dev/zero, /dev/random ou /dev/urandom ?</h3><p><em>Pour cette partie, je me suis largement inspiré des manpages de random que j&#8217;ai agrémentée d&#8217;exemples et quelques précisions</em>.</p><p>Les fichiers spéciaux /dev/random et /dev/urandom existents depuis Linux 1.3.30 et ils fournissent une interface avec le générateur de nombres aléatoires du noyau. Il faut savoir que le noyau identifie chaque périphérique au moyen de deux numéros, le majeur (à gauche) et le mineur (à droite), ex:</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>dev<br /> crw-rw-rw- <span style="color: #000000;">1</span> root root <span style="color: #000000;">1</span>, <span style="color: #000000;">5</span> avr <span style="color: #000000;">29</span> <span style="color: #000000;">14</span>:07 zero<br /> crw-rw-rw- <span style="color: #000000;">1</span> root root <span style="color: #000000;">1</span>, <span style="color: #000000;">8</span> avr <span style="color: #000000;">29</span> <span style="color: #000000;">14</span>:07 random<br /> crw-rw-rw- <span style="color: #000000;">1</span> root root <span style="color: #000000;">1</span>, <span style="color: #000000;">9</span> avr <span style="color: #000000;">29</span> <span style="color: #000000;">14</span>:07 urandom</div></td></tr></tbody></table></div><p>Le fichier /dev/random a un numéro de périphérique majeur égal à 1, et un numéro mineur égal à 8. Les numéros du périphérique /dev/urandom sont 1 pour le majeur, et 9 pour le mineur et pour zero ils sont respectivement de 1 et 5. Ils sont de type c (Character), ils communiquent octet par octet (comme un port série) à l&#8217;inverse des disques durs qui sont de type b (Blocks) et qui &#8211; donc &#8211; communiquent par blocs de données.</p><p>Ce que l&#8217;on peut lire dans la documentation de noyau Linux a leurs propos :</p><pre>1 char Memory device
    ...
    5 = /dev/zero        Null byte source
    ...
    8 = /dev/random   Nondeterministic random number gen.
    9 = /dev/urandom Faster, less secure random number gen.
    ...</pre><p>En réalité, le générateur de nombres aléatoires récupère les séquences aléatoires en fonction du « bruit » généré par l&#8217;environnement : mouvement de la souris, frappe au clavier, etc.. Le générateur mémorise également une estimation du nombre de bits de bruit dans son réservoir d&#8217;entropie, et utilise son contenu pour créer des nombres aléatoires.<br /> <strong>En effet, lors d&#8217;une lecture, le périphérique /dev/random sera limité au nombre de bits de bruit qu&#8217;il contient</strong>.<br /> /dev/random est particulièrement adapté pour des cas où l&#8217;on a ponctuellement besoin de nombres hautement aléatoires (création de clés par exemple). Lorsque le réservoir d&#8217;entropie est vide, les lectures du périphérique /dev/random seront bloquantes jusqu&#8217;à l&#8217;obtention de suffisamment de bruits en provenance de l&#8217;environnement. Dans notre cas &#8211; ou l&#8217;on a besoin d&#8217;une très grande quantité de données —, nous risquons d&#8217;être très rapidement limité ! Heureusement, /dev/urandom renverra autant d&#8217;octets qu&#8217;on en demande. Toutefois, s&#8217;il n&#8217;y a plus assez de bits disponibles dans le réservoir d&#8217;entropie, les valeurs renvoyées pourraient être théoriquement vulnérables à une cryptanalyse basée sur l&#8217;algorithme employé par le pilote. Il n&#8217;existe pas de documentation sur ce type d&#8217;attaque dans la littérature publique actuelle, mais cela n&#8217;élimine pas le risque théorique.</p><p>Le fichier de périphérique /dev/zero quand a lui, se comporte comme s’il contenait une infinité d’octets à ~0. Quelle que soit la quantité de données que vous essayez de lire à partir de /dev/zero, il générera suffisamment d’octets nuls.</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">hexdump</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero<br /> 0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br /> <span style="color: #000000; font-weight: bold;">*</span></div></td></tr></tbody></table></div><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">hexdump</span> <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>random<br /> 00000000 c8 6a <span style="color: #000000;">22</span> ab 8a cb a2 <span style="color: #000000;">66</span> <span style="color: #000000;">17</span> 7a ce 8d d6 e8 e1 fa <span style="color: #000000; font-weight: bold;">|</span>?j<span style="color: #ff0000;">&quot;?.ˢf.z?.????|<br /> 00000010 c1 69 7c d1 64 39 44 cc be 8f 06 db 88 1e 5c ba |?i|?d9D̾..?..\?|<br /> 00000020 99 9d a3 f7 cb ff a4 ea 43 c1 b4 ea b8 ba f9 71 |..??????C??긺?q|<br /> ...</span></div></td></tr></tbody></table></div><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">hexdump</span> <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>urandom<br /> 00000000 <span style="color: #000000;">49</span> db 3d 9e <span style="color: #000000;">25</span> bf <span style="color: #000000;">14</span> b9 b8 a6 <span style="color: #000000;">58</span> <span style="color: #000000;">22</span> b1 <span style="color: #000000;">13</span> 7b <span style="color: #000000;">29</span> <span style="color: #000000; font-weight: bold;">|</span>I?=.<span style="color: #000000; font-weight: bold;">%</span>?.???X<span style="color: #ff0000;">&quot;?.{)|<br /> 00000010 33 40 bf 14 e5 aa 99 c9 a0 ee fb 5c 74 5a 01 d6 |3@?.?.ɠ??<span style="color: #000099; font-weight: bold;">\t</span>Z.?|<br /> 00000020 6b 45 33 6c a4 d6 69 54 53 d8 17 55 ba dc 8c 76 |kE3l??iTS?.U??.v|<br /> ...</span></div></td></tr></tbody></table></div><p>En résumé, nous allons plutôt utiliser /dev/urandom ou /dev/zero, sinon ça va prendre un temps fou. /dev/random donne de l&#8217;entropie &laquo;&nbsp;forte&nbsp;&raquo; (liée au matériel) et ne donne donc que quelques octets par seconde. /dev/urandom complète cette entropie forte avec du PRNG et génère donc les données aussi vite que nécessaire, ou presque..</p><p><strong>Dans le cas d&#8217;un effacement de disque dur, ce risque nous importe peu, mais je trouvais intéressant d&#8217;en parler.</strong></p><p>Petites précisions pour les BSD Users:<br /> 1) Le générateur de bruit random a été remplacé par un générateur cryptographique nommé « <a rel="nofollow" href="http://fr.wikipedia.org/wiki/Yarrow">Yarrow algorithm</a> » ;<br /> 2) /dev/urandom est un lien symbolique sur /dev/random.<br /> 3) Les numéros mineurs et majeurs ne sont pas les mêmes, ex:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ls -l /dev | grep random<br /> crw-rw-rw- 1 root wheel 8, 0 5 mai 15:23 random<br /> crw-rw-rw- 1 root wheel 8, 1 3 mai 15:52 urandom</div></td></tr></tbody></table></div><h3>Vérifications</h3><p>Pour vérifier l&#8217;oeuvre de la commande dd couplée à random, nous allons utiliser « hexdump » (sur un fichier de 64b, pour une question de lisibilité).</p><p>Utilisons &laquo;&nbsp;zero&nbsp;&raquo; comme générateur:</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">bs</span>=<span style="color: #000000;">64</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">hexdump</span> <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>^00<span style="color: #7a0874; font-weight: bold;">&#93;</span><br /> <span style="color: #000000;">1</span>+<span style="color: #000000;">0</span> records <span style="color: #000000; font-weight: bold;">in</span><br /> <span style="color: #000000;">1</span>+<span style="color: #000000;">0</span> records out<br /> <span style="color: #000000;">64</span> bytes transferred <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">0.000035</span> secs <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1826092</span> bytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#41;</span><br /> <span style="color: #000000;">0</span>+<span style="color: #000000;">1</span> records <span style="color: #000000; font-weight: bold;">in</span><br /> <span style="color: #000000;">0</span>+<span style="color: #000000;">1</span> records out<br /> <span style="color: #000000;">64</span> bytes transferred <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">0.000018</span> secs <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">3532045</span> bytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#41;</span><br /> 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <span style="color: #000000; font-weight: bold;">|</span>................<span style="color: #000000; font-weight: bold;">|</span><br /> <span style="color: #000000; font-weight: bold;">*</span><br /> 00000040</div></td></tr></tbody></table></div><p>Quand à utiliser &laquo;&nbsp;random&nbsp;&raquo;, voici le résultat :</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>random <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">bs</span>=<span style="color: #000000;">64</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">hexdump</span> <span style="color: #660033;">-C</span><br /> <span style="color: #000000;">1</span>+<span style="color: #000000;">0</span> records <span style="color: #000000; font-weight: bold;">in</span><br /> <span style="color: #000000;">1</span>+<span style="color: #000000;">0</span> records out<br /> <span style="color: #000000;">64</span> bytes transferred <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">0.000040</span> secs <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1597830</span> bytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#41;</span><br /> <span style="color: #000000;">0</span>+<span style="color: #000000;">1</span> records <span style="color: #000000; font-weight: bold;">in</span><br /> <span style="color: #000000;">0</span>+<span style="color: #000000;">1</span> records out<br /> <span style="color: #000000;">64</span> bytes transferred <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">0.000016</span> secs <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4006499</span> bytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#41;</span><br /> 00000000 <span style="color: #000000;">68</span> 0f 9a a5 f8 9c 1a <span style="color: #000000;">45</span> fa ce c2 04 <span style="color: #000000;">64</span> 0d 3a a2 <span style="color: #000000; font-weight: bold;">|</span>h..??..E???.d.:?<span style="color: #000000; font-weight: bold;">|</span><br /> 00000010 d5 <span style="color: #000000;">59</span> f1 <span style="color: #000000;">10</span> 05 4a <span style="color: #c20cb9; font-weight: bold;">cc</span> b0 ec <span style="color: #000000;">69</span> 3a <span style="color: #000000;">26</span> f6 f9 <span style="color: #000000;">42</span> c3 <span style="color: #000000; font-weight: bold;">|</span>?Y?..J̰?i:<span style="color: #000000; font-weight: bold;">&amp;</span>amp;??B?<span style="color: #000000; font-weight: bold;">|</span><br /> 00000020 <span style="color: #000000;">28</span> <span style="color: #000000;">81</span> <span style="color: #000000;">32</span> 7b 3e f5 7c 3a a8 d9 <span style="color: #000000;">75</span> <span style="color: #000000;">63</span> bd <span style="color: #000000;">16</span> <span style="color: #000000;">21</span> 8e <span style="color: #000000; font-weight: bold;">|</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>.2<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;?<span style="color: #000000; font-weight: bold;">|</span>:??uc?.<span style="color: #000000; font-weight: bold;">!</span>.<span style="color: #000000; font-weight: bold;">|</span><br /> 00000030 9a 9e <span style="color: #000000;">28</span> <span style="color: #000000;">43</span> <span style="color: #c20cb9; font-weight: bold;">bc</span> <span style="color: #000000;">69</span> 3c 7a <span style="color: #000000;">53</span> <span style="color: #000000;">11</span> 8b 9b 7c 8d <span style="color: #000000;">86</span> 2e <span style="color: #000000; font-weight: bold;">|</span>..<span style="color: #7a0874; font-weight: bold;">&#40;</span>C?i 00000040</div></td></tr></tbody></table></div><p>Vous pourrez, naturellement vérifier le résultat en situation « réelle » grace a la commande suivante :</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdX <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">hexdump</span> <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>^00<span style="color: #7a0874; font-weight: bold;">&#93;</span></div></td></tr></tbody></table></div><h2>Note finale</h2><p>Il existe des logiciels comme &laquo;&nbsp;Shred&nbsp;&raquo; qui offrent des solutions « clés en main », mais qui au final ne font que ce que vous auriez très bien pu faire avec &laquo;&nbsp;dd&nbsp;&raquo; (un nombre X de passes random puis finir sur une &laquo;&nbsp;zero&nbsp;&raquo;), ex:</p><p>Les deux lignes suivantes font la même chose:</p><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">shred</span> <span style="color: #660033;">-fzv</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">16</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdX</div></td></tr></tbody></table></div><div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">for</span> n <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">seq</span> <span style="color: #000000;">15</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>urandom <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdX <span style="color: #007800;">conv</span>=notrunc; <span style="color: #000000; font-weight: bold;">done</span>; <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdX <span style="color: #007800;">conv</span>=notrunc</div></td></tr></tbody></table></div><p>sachant que &#8211; pour un disque de 500Go &#8211; dd a été le plus rapide chez moi.</p><p>Il existe un ensemble d’outils nommé « secure_deletion toolkit », mais il n&#8217;est pas encore porté sur toutes les plates-formes. Par exemple, l&#8217;outil « sfill » pousse l&#8217;effacement sécurisé des fichiers à son paroxysme :</p><p>* Une passe avec 0xff<br /> * 5 passes aléatoires avec la source /dev/urandom<br /> * 27 passes avec des valeurs spéciales définies par Peter Gutmann. (<a rel="nofollow" href="http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html">Je vous invite d&#8217;ailleurs a lire son article très complet si vous voulez en savoir plus.</a>)<br /> * A nouveau 5 passes aléatoires.<br /> * Une passe avec 0&#215;00.</p><p><strong>Il est peu être possible de lire « à côté des pistes », des résidus magnétisés et de retrouver ainsi des données écrites préalablement en décalant les têtes et peut être existe&#8217;il d&#8217;autres méthodes dont nous n&#8217;avons pas connaissance alors il reste une solution universelle et radicale : La destruction physique. C&#8217;est la seule solution réellement viable et irrécupérable : Perceuse, Masse, Acide et j&#8217;en passe..</strong></p><p><strong>Le générateur random et l&#8217;utilitaire dd sont disponibles sur énormément de distributions : Solaris, Mac OS X, FreeBSD, HP-UX, Tru64, AIX et j&#8217;en passe.</strong></p> ]]></content:encoded> <wfw:commentRss>http://www.crashdump.fr/debian/effacer-definivement-toutes-les-donnees-dun-disque-dur-sous-nux-677/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>hTop, un monitoring plus user-friendly.</title><link>http://www.crashdump.fr/tout-et-rien/htop-un-monitoring-plus-user-friendly-436/</link> <comments>http://www.crashdump.fr/tout-et-rien/htop-un-monitoring-plus-user-friendly-436/#comments</comments> <pubDate>Sat, 15 Nov 2008 17:32:16 +0000</pubDate> <dc:creator>Crashdump</dc:creator> <category><![CDATA[Tout-et-Rien]]></category> <category><![CDATA[cpu]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[htop]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[mémoire vive]]></category> <category><![CDATA[monitoring]]></category> <category><![CDATA[ncurses]]></category> <category><![CDATA[swap]]></category> <category><![CDATA[système]]></category><guid isPermaLink="false">http://www.crashdump.fr/?p=436</guid> <description><![CDATA[<p><img width="250" height="150" src="http://www.crashdump.fr/wp-content/uploads/2008/11/htop.jpg" class="attachment-featured-image wp-post-image" alt="htop" title="htop" /></p><br />Alors que je surfouillais sur le web, un samedi après midi, je suis tombé sur un screenshot qui m&#8217;as intrigé.. top aurais évolué ? ça y ressemblait bien. Après quelques recherches je suis tombé dessus, le messie du monitoring ! Qu&#8217;est ce que c&#8217;est ? htop est un moniteur système pour Linux, presque le même [...]]]></description> <content:encoded><![CDATA[<p><img width="250" height="150" src="http://www.crashdump.fr/wp-content/uploads/2008/11/htop.jpg" class="attachment-featured-image wp-post-image" alt="htop" title="htop" /></p><br /><p>Alors que je surfouillais sur le web, un samedi après midi, je suis tombé sur un screenshot qui m&#8217;as intrigé.. top aurais évolué ? ça y ressemblait bien. Après quelques recherches je suis tombé dessus, le messie du monitoring !</p><li><h3>Qu&#8217;est ce que c&#8217;est ?</h3></li><p>htop est un moniteur système pour Linux, presque le même que top, que nous connaissons tous. Mais qui propose &#8211; enfin ? &#8211; une interface plus conviviale que ce dernier. Il est programmé en C à l&#8217;aide de la bibliothèque &#8216;ncurses&#8217;.</p><li><h3>Ca ressemble à quoi ?</h3></li><p><a href="http://www.crashdump.fr/wp-content/uploads/2008/11/htop-screen.jpg"><img src="http://www.crashdump.fr/wp-content/uploads/2008/11/htop-screen-430x125.jpg" alt="" title="htop-screen" width="430" height="125" class="alignnone size-thumbnail wp-image-438" /></a></p><li><h3>Comparaison top/htop</h3></li><p>+ htop permet de &#8216;tuer&#8217; un processus directement, sans se soucier de son PID.<br /> + htop permet, de la même manière, d&#8217;augmenter/réduire la priorité d&#8217;un processus dans connaître son PID.<br /> + htop est plus user-friendly, dans ses raccourcis, et sa présentation, le scroll.<br /> + htop permet un affichage en arborescence, identifiant clairement les processus pères et fils.<br /> + htop est plus rapide (sur les 3 machines sur lesquelles je l&#8217;ai testé). et vous ?<br /> + htop gère la souris (mettons de côté les réactions d&#8217;extrémiste du clavier..)<br /> + htop intègre une  jauge de l&#8217;utilisation de la mémoire vive, cpu et swap (gadget, oui&#8230; mais sympa)<br /> - Top est sûrement plus stable et plus précis.. car plus vieux et donc plus testé.</p><li><h3>Ou le récuperer ?</h3></li><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">aptitude install htop</div></td></tr></tbody></table></div><p>ou <a rel="nofollow" href="http://htop.sourceforge.net/">http://htop.sourceforge.net/</a></p> ]]></content:encoded> <wfw:commentRss>http://www.crashdump.fr/tout-et-rien/htop-un-monitoring-plus-user-friendly-436/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Sécuriser un serveur linux (Partie 1)</title><link>http://www.crashdump.fr/securite/securiser-un-serveur-linux-partie-1-155/</link> <comments>http://www.crashdump.fr/securite/securiser-un-serveur-linux-partie-1-155/#comments</comments> <pubDate>Wed, 16 Jul 2008 19:16:57 +0000</pubDate> <dc:creator>Crashdump</dc:creator> <category><![CDATA[Sécurité]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[passwd]]></category> <category><![CDATA[suid]]></category> <category><![CDATA[tutoriel]]></category><guid isPermaLink="false">http://blog.crashdump.fr/?p=155</guid> <description><![CDATA[Vous le savez, Linux est un -si ce n&#8217;est le- plus stable des OS que l&#8217;on puisse croiser de nos jours. C&#8217;est aussi un système très populaire. Peut importe ce dont vous avez besoin, vous trouverez chaussure a votre pied&#8230; Mais il ne faut pas faire les choses n&#8217;importe comment, je vais donc essayer d&#8217;aborder [...]]]></description> <content:encoded><![CDATA[<p><em>Vous le savez, Linux est un -si ce n&#8217;est le- plus stable des OS que l&#8217;on puisse croiser de nos jours. C&#8217;est aussi un système très populaire. Peut importe ce dont vous avez besoin, vous trouverez chaussure a votre pied&#8230; Mais il ne faut pas faire les choses n&#8217;importe comment, je vais donc essayer d&#8217;aborder ici un point très important: La sécurité. </em></p><p><strong>Attention, je n&#8217;ai jamais eu la prétention d&#8217;être un expert dans ce domaine, je vais donc seulement vous parler de ce je connais.. (les bases). Lire cet article ne vous rendra pas aussi populaire que Kevin Mitnik ou assimilé. De plus c&#8217;est un domaine très vaste et en constante évolution. Un bon administrateur saura se tenir informé et devra s&#8217;y intéresser: <a rel="nofollow" href="http://www.securityfocus.com/">http://www.securityfocus.com/</a>, <a rel="nofollow" href="http://www.linuxsecurity.com/">http://www.linuxsecurity.com/</a>&#8230; seront de bonnes sources d&#8217;inspiration :)</strong><br /> <span id="more-155"></span></p><h2><li>l&#8217;Installation</li></h2><p>Tout d&#8217;abord je vais supposer que vous savez installer la distribution qui vous intéresse et que c&#8217;est fait &#8211; beau raccourci, hein ! &#8211; Mais sans X11.. parceque-c&#8217;est-moche-et-que-je-suis-un-l33t ? Non. Mais dans ce tutoriel, je ne l&#8217;aborderais pas.</p><p>Règle n°1: Si vous n&#8217;avez pas besoin de quelque chose (services, applications..) ne l&#8217;activez pas ! C&#8217;est très important, la raison est simple: Plus vous avez de services activés, plus vous encourez le risque d&#8217;être vulnérable a un exploit&#8230; Un chemin royal pour qui en voudrait a vôtre machine.</p><h2><li>Verrouillage</li></h2><p>Première étape pour sécuriser vôtre serveur, plusieurs choses importantes:</p><p><strong>Changer le mot de passe root:</strong> J&#8217;insiste sur ce point, mais je vois trop souvent de mot de passes composés de quelques lettres ! Dans la plupart des cas, il devra être composé d&#8217;au moins 12 caractères dont 4 spéciaux (%*/;&#8230;) et 4 numériques. ex: Rv1-45/o;.V6 qui est considéré comme fort. Hey, vous au fond ! Inutile de l&#8217;écrire sous le clavier, juste un petit effort pour le retenir.. ;)<br /> De plus, le changer régulièrement c&#8217;est pas une mauvaise chose.. tout les 2 mois par exemple.<br /> Sachez qu&#8217;il existe des application qui peuvent &laquo;&nbsp;scanner&nbsp;&raquo; vos machines pour essayer différents mot de passes a partir de &laquo;&nbsp;dictionnaires&nbsp;&raquo;, donc évitez la date de naissance de votre belle-mère.<br /> Pour ce qui est des scanners (brute-force) nous verrons, plus tard comment s&#8217;en protéger un minimum.</p><p>Pour changer votre mot de passe root:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># passwd</div></td></tr></tbody></table></div><p>Pour changer le mot de passe de l&#8217;un de vos utilisateurs:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># passwd lenomdelutilisateur</div></td></tr></tbody></table></div><p><strong>Désactiver les suid:</strong> Parfois très pratiques &#8211; et très dangereux &#8211; le SUID (&laquo;&nbsp;Set User ID&nbsp;&raquo;) vous permet de faire fonctionner une application en tant qu&#8217;autre utilisateur. Imaginez que quelqu&#8217;un ai accès a l&#8217;une de ces applications (via un shell, apache).. et puisse lire votre /etc/shadow.. toute la sécurité de votre serveur serait compromise.</p><p>Pour trouver tout les binaires qui utilisent un SUID, tapez la ligne suivante:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:450px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># ls -alF `find / -perm -4000` | more<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp;60104 Apr &nbsp;1 &nbsp;2002 /bin/mount*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;35192 Apr 18 &nbsp;2002 /bin/ping*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;19116 Apr &nbsp;8 &nbsp;2002 /bin/su*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;30664 Apr &nbsp;1 &nbsp;2002 /bin/umount*<br /> -r-sr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;120264 Apr &nbsp;9 &nbsp;2002 /sbin/pwdb_chkpwd*<br /> -r-sr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;16992 Apr &nbsp;9 &nbsp;2002 /sbin/unix_chkpwd*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;37528 Jan 17 &nbsp;2002 /usr/bin/at*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;34296 Mar 27 &nbsp;2002 /usr/bin/chage*<br /> -rws--x--x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;12072 Apr &nbsp;1 &nbsp;2002 /usr/bin/chfn*<br /> -rws--x--x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;11496 Apr &nbsp;1 &nbsp;2002 /usr/bin/chsh*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;21080 Apr 15 &nbsp;2002 /usr/bin/crontab*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;36100 Mar 27 &nbsp;2002 /usr/bin/gpasswd*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;19927 Apr 17 &nbsp;2002 /usr/bin/lppasswd*<br /> -rws--x--x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;4764 Apr &nbsp;1 &nbsp;2002 /usr/bin/newgrp*<br /> -r-s--x--x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;15104 Mar 13 &nbsp;2002 /usr/bin/passwd*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;14588 Jul 24 &nbsp;2001 /usr/bin/rcp*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;10940 Jul 24 &nbsp;2001 /usr/bin/rlogin*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;7932 Jul 24 &nbsp;2001 /usr/bin/rsh*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;219932 Apr &nbsp;4 &nbsp;2002 /usr/bin/ssh*<br /> ---s--x--x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;84680 Apr 18 &nbsp;2002 /usr/bin/sudo*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;32673 Apr 18 &nbsp;2002 /usr/sbin/ping6*<br /> -r-sr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;451280 Apr &nbsp;8 &nbsp;2002 /usr/sbin/sendmail.sendmail*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;20140 Mar 14 &nbsp;2002 /usr/sbin/traceroute*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;13994 Apr 18 &nbsp;2002 /usr/sbin/traceroute6*<br /> -rws--x--x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;22388 Apr 15 &nbsp;2002 /usr/sbin/userhelper*<br /> -rwsr-xr-x &nbsp; &nbsp;1 root &nbsp; &nbsp; root &nbsp; &nbsp;17461 Apr 19 &nbsp;2002 /usr/sbin/usernetctl*</div></td></tr></tbody></table></div><p><em>NOTE: Le &laquo;&nbsp;s&nbsp;&raquo; signifie que le fichier est SUID.</em></p><p>La plupart des administrateurs systèmes recommandent de désactiver les services comme &laquo;&nbsp;ping&nbsp;&raquo; ou traceroute&nbsp;&raquo; (lorsque vous n&#8217;en avec pas besoin).. Je vous conseillerais de désactiver, dans ce cas: chage, chfn, chsh, mount, umount, gpasswd, usernetctl, traceroute, traceroute6, newgrp, ping6, ping.</p><p>Désactiver le SUID sur ces binaires empêche tout autre utilisateur que le propriétaire de l&#8217;exécuter (tout en sachant que la plupart de ces services aurons besoin d&#8217;être exécuté en root pour fonctionner)</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># chmod 111 /chemin/du/binaire<br /> # chattr +I /chemin/du/binaire</div></td></tr></tbody></table></div> ]]></content:encoded> <wfw:commentRss>http://www.crashdump.fr/securite/securiser-un-serveur-linux-partie-1-155/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Créer son serveur World Of Warcraft privé (Avec Ascent/Linux) Rev.2!</title><link>http://www.crashdump.fr/tout-et-rien/creer-son-serveur-world-of-warcraft-prive-avec-ascentlinux-rev2-150/</link> <comments>http://www.crashdump.fr/tout-et-rien/creer-son-serveur-world-of-warcraft-prive-avec-ascentlinux-rev2-150/#comments</comments> <pubDate>Sun, 18 May 2008 20:50:48 +0000</pubDate> <dc:creator>Crashdump</dc:creator> <category><![CDATA[Tout-et-Rien]]></category> <category><![CDATA[ascent]]></category> <category><![CDATA[Emulation]]></category> <category><![CDATA[GRANT ALL]]></category> <category><![CDATA[GRANT USAGE]]></category> <category><![CDATA[installer]]></category> <category><![CDATA[Lancé]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[server]]></category> <category><![CDATA[serveur]]></category> <category><![CDATA[tutoriel]]></category> <category><![CDATA[World of warcraft]]></category> <category><![CDATA[wow]]></category><guid isPermaLink="false">http://blog.crashdump.fr/?p=150</guid> <description><![CDATA[Voila, la révision 2 du tutoriel &#171;&#160;Créer son serveur World Of Warcraft privé (Avec Ascent/Linux)&#160;&#187; est enfin arrivé ! Pour cela j&#8217;ai tout repris a zéro, avec l&#8217;expérience que j&#8217;ai acquise dans le domaine de l&#8217;émulation j&#8217;espère pouvoir vous proposer un article complet et pas trop foireux, mais avant tout accessible a tous&#8230; Allez sans [...]]]></description> <content:encoded><![CDATA[<p>Voila, la révision 2 du tutoriel &laquo;&nbsp;Créer son serveur World Of Warcraft privé (Avec Ascent/Linux)&nbsp;&raquo; est enfin arrivé ! Pour cela j&#8217;ai tout repris a zéro, avec l&#8217;expérience que j&#8217;ai acquise dans le domaine de l&#8217;émulation j&#8217;espère pouvoir vous proposer un article complet et pas trop foireux, mais avant tout accessible a tous&#8230; Allez sans plus attendre, on attaque.<span id="more-150"></span></p><p># -&gt; Loggué en tant que root.<br /> $ -&gt; Loggué en tant qu&#8217;utilisateur (wowsvr, ici)</p><li><h2>Mysql</h2></li><p>Si vous n&#8217;avez pas déj�  installé Mysql sur votre serveur:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># apt-get install mysql</div></td></tr></tbody></table></div><p>Puis on se connecte sur ce serveur:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># mysql -uroot -p</div></td></tr></tbody></table></div><p>La, on va créer un utilisateur ascent, une base de son nom et les 3 tables puis lui alouer les droits dessus:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;gt; CREATE USER 'ascent'@'localhost' IDENTIFIED BY 'MotDePasseAscent'; (DeF4Vv%e31E)<br /> &amp;gt; GRANT USAGE ON *.* TO 'ascent'@'localhost' IDENTIFIED BY 'MotDePasseAscent';<br /> &amp;gt; create database world;<br /> &amp;gt; create database logon;<br /> &amp;gt; create database characters;<br /> &amp;gt; GRANT ALL PRIVILEGES ON `world` . * TO 'ascent'@'localhost';<br /> &amp;gt; GRANT ALL PRIVILEGES ON `logon` . * TO 'ascent'@'localhost';<br /> &amp;gt; GRANT ALL PRIVILEGES ON `characters` . * TO 'ascent'@'localhost';</div></td></tr></tbody></table></div><p>On recharge les privilèges et on quitte:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;gt; FLUSH PRIVILEGES;<br /> &amp;gt; quit</div></td></tr></tbody></table></div><li><h2>Compilation du Core</h2></li><p>Tout d&#8217;abord, installons les outils dont on aura besoin par la suite:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># apt-get install subversion libmysql++-dev libssl-dev libtool gcc automake g++ autoconf build-essential openssl libtool libpcre3-dev unrar</div></td></tr></tbody></table></div><p>Puis ajoutons l&#8217;utilisateur qui fera &#8216;tourner&#8217; le serveur:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># adduser wowsvr<br /> # su wowsvr<br /> $ cd</div></td></tr></tbody></table></div><p>Rapatrions les derniers fichiers de Ascent sur notre machine:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ svn co http://mmoforge.org/svn/ascent/<br /> $ cd ascent/trunk/</div></td></tr></tbody></table></div><p>On configure:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ autoreconf --install --force<br /> $ ./configure --prefix=/home/wowsvr/ascent-server</div></td></tr></tbody></table></div><p>(j&#8217;ai eu des soucis de compilation avec gcc4.2.. par contre nickel avec gcc4.1)<br /> # aptitude install gcc-4.1 gcc-4.1-base<br /> # update-alternatives &#8211;install /usr/bin/gcc gcc /usr/bin/gcc-4.1 40 &#8211;slave /usr/bin/g++ g++ /usr/bin/g++-4.1<br /> (update-alternatives &#8211;config gcc pour changer de version de gcc/g++)</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sh make_precompiled_header.sh</div></td></tr></tbody></table></div><p>On compile:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ make -j2</div></td></tr></tbody></table></div><p>Et on installe:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ make install</div></td></tr></tbody></table></div><li><h2>Configuration</h2></li><p>Passons maintenant a la configuration &#8211; Attention, ici je vous ais détaillé la configuration minimale pour que le serveur fonctionne, mais je vous invite a lire les fichiers, ils sont très détaillés et compréhensibles)</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ echo &quot;/home/wowsvr/ascent-server/lib&quot; &amp;gt; /etc/ld.so.conf.d/ascent.conf<br /> $ mkdir /home/wowsvr/ascent-server/etc<br /> $ cp src/*.conf /home/wowsvr/ascent-server/etc/<br /> $ cd /home/wowsvr/ascent-server/etc/</div></td></tr></tbody></table></div><p>Editez les lignes suivantes (pour passer en mode édition tapez: &laquo;&nbsp;i&nbsp;&raquo; et &laquo;&nbsp;Echap&nbsp;&raquo; pour quitter le mode. Pour sauvegarder tapez: &laquo;&nbsp;:wq!&nbsp;&raquo;)</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vim ascent-logonserver.conf<br /> 032:<br /> 033: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Username = &quot;ascent&quot;<br /> 034: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Password = &quot;MotDePasseAscent&quot;<br /> 035: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Name &nbsp; &nbsp; = &quot;logon&quot;<br /> 112:<br /> 113: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AllowedIPs = &quot;127.0.0.1/24&quot;<br /> 114: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AllowedModIPs = &quot;127.0.0.1/24&quot;&amp;gt;</div></td></tr></tbody></table></div><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vim ascent-realm.conf<br /> 036:<br /> 038: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Name = &quot;DonnezLuiUnNom&quot;<br /> 064:<br /> 066: &nbsp; &nbsp; &nbsp; &nbsp; Icon = &quot;PVP&quot; (ici: PVP, Normal, RPPVP, RP)</div></td></tr></tbody></table></div><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vim ascent-world.conf<br /> 031:<br /> 032:<br /> 210: # (commenter: rajouter un # en debut de ligne)<br /> 480: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RemotePassword = &quot;MotDePasseRemoteAscent&quot;&amp;gt;<br /> 698: # (commenter: rajouter un # en debut de ligne)</div></td></tr></tbody></table></div><p>Bon, la on a déj�  fait un grand morceau du chemin! Allez courage !</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ cd ../bin</div></td></tr></tbody></table></div><li><h2>Maps, vMaps, DBC</h2></li><p>On crée les 3 dossiers qui vons contenir les maps, les vmaps et les DBC</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ mkdir maps; mkdir vmaps; mkdir DBC;</div></td></tr></tbody></table></div><p>Je met a votre disposition les fichiers que j&#8217;ai pu trouver sur le net:<br /> DBC: http://www.megaupload.com/fr/?d=QF5KGDWH ou http://www.megaupload.com/fr/?d=EY3C7NLV<br /> maps: http://dl.free.fr/iHWpvBSjy/maps.rar ou http://www.megaupload.com/fr/?d=657UAN8X<br /> vmaps: http://dl.free.fr/kjaMn7jDb/vmaps.rar ou http://www.megaupload.com/?d=ZPTMQYY3 ou http://www.megaupload.com/?d=BPNLKG40<br /> a copier dans les 3 dossiers qu&#8217;on a créé ci-dessus&#8230;</p><li><h2>Retour sur Mysql</h2></li><p>Bon maintenant, on va creer la structure des tables:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ mysql -uascent -p world &amp;lt; /home/wowsvr/ascent/trunk/sql/2785_world_structure.sql<br /> $ mysql -uascent -p logon &amp;lt; /home/wowsvr/ascent/trunk/sql/2785_logon_structure.sql<br /> $ mysql -uascent -p characters &amp;lt; /home/wowsvr/ascent/trunk/sql/2785_character_structure.sql</div></td></tr></tbody></table></div><p>Puis on va appliquer les mises a jours &#8211; attention, il peut y avoir des erreurs, ignorez les.. rien de grave.</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ cd world_updates<br /> $ for LIST in *; do mysql -uascent --password=MotDePasseMysql world &amp;lt; $LIST; done;<br /> $ cd ../logon_updates<br /> $ for LIST in *; do mysql -uascent --password=MotDePasseMysql logon &amp;lt; $LIST; done;<br /> $ cd ../character_updates<br /> $ for LIST in *; do mysql -uascent --password=MotDePasseMysql characters &amp;lt; $LIST; done;<br /> $ cd /home/wowsvr/</div></td></tr></tbody></table></div><p>Maintenant, on va télécharger une Base de données des PNJ, Mobs, Skills&#8230; bref le contenu du jeu !</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ svn co http://svn2.assembla.com/svn/Wow_Ascent_Arbonne_DB/WAAD/</div></td></tr></tbody></table></div><p>Puis a l&#8217;aide du script fourni, on va l&#8217;injecter ! Pour cela, il va falloir configurer un petit peu la moulinette:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ cd WAAD/<br /> $ vim Waad.sh<br /> 02: user=&quot;ascent&quot;<br /> 03: pass=&quot;MotDePasseMysql&quot;<br /> 04: wdb=&quot;world&quot;<br /> 05: cdb=&quot;characters&quot;<br /> $ chmod +x Waad.sh</div></td></tr></tbody></table></div><p>Et convertir les fin de lignes format windows ^M au format Linux:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ perl -pi -e 's/r//g' Waad.sh</div></td></tr></tbody></table></div><p>Allez, on lance le tout !</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ./Waad.sh</div></td></tr></tbody></table></div><p>Tapez w<br /> Tapez x</p><p>A ce niveau la je ne peut que vous conseiller de jeter un œil au fichier Notes de version, il y aura peut être des correctifs (.sql) a appliquer en fonction de la version utilisée..</p><p>Je vous fourni, dans mon extrême gentillesse un script de lancement des binaires:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ cat &amp;lt; launcher.sh</div></td></tr></tbody></table></div><p>Collez y ça:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:450px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/bash<br /> # Logon..<br /> L_SRV=&quot;./ascent-logonserver&quot;<br /> L_PID=&quot;./logonserver.pid&quot;<br /> # Core..<br /> C_SRV=&quot;./ascent-world&quot;<br /> C_PID=&quot;./ascent.pid&quot;<br /> echo &quot;$(date) Lancement des aplications de Ascent...&quot;;<br /> # On coupe tout process du logonserver lancé précedement..<br /> killall logonserver;<br /> sleep 1;<br /> rm -f $L_PID;<br /> sleep 1;<br /> screen -dmS wowCore nice $L_SRV;<br /> # On coupe tout process du Core lancé précedement..<br /> killall ascent;<br /> sleep 1;<br /> rm -f $C_PID;<br /> sleep 1;<br /> screen -dmS wowLogon nice $C_SRV;<br /> echo &quot;$(date) Lancé.&quot;<br /> while [ true ]; do<br /> sleep 15;<br /> echo &quot;$(date) Test si les processus son démaré...&quot;;<br /> if [ &quot;0&quot; = &quot;$(ps x | grep -e logonserver | grep -v grep | wc -l)&quot; ]; then<br /> echo &quot;$(date) Erreur: LogonServer serveur a crashé!&quot;;<br /> echo &quot;$(date) mise en attente...&quot;;<br /> sleep 5;<br /> if [ &quot;0&quot; = &quot;$(ps x | grep -e logonserver | grep -v grep | wc -l)&quot; ]; then<br /> echo &quot;$(date) Crash! Relancement du serveur LogonServer...&quot;;<br /> # On Relance...<br /> killall logonserver;<br /> sleep 1;<br /> rm -f $L_PID;<br /> sleep 1;<br /> screen -dmS wowCore nice $L_SRV;<br /> # On détruit les eventuelles sessions &quot;mortes&quot;<br /> screen -wipe;<br /> echo &quot;$(date) lancé.&quot;;<br /> else<br /> echo &quot;$(date) Processus déja démaré.&quot;;<br /> fi<br /> fi<br /> if [ &quot;0&quot; = &quot;$(ps x | grep -e ascent | grep -v grep &nbsp;| wc -l)&quot; ]; then<br /> echo &quot;$(date) Erreur: Ascent serveur a crashé!&quot;;<br /> echo &quot;$(date) mise en attente...&quot;;<br /> sleep 5;<br /> if [ &quot;0&quot; = &quot;$(ps x | grep -e ascent | grep -v grep | wc -l)&quot; ]; then<br /> echo &quot;$(date) Crash! Relancement du serveur Ascent...&quot;;<br /> # On relance ...<br /> killall ascent;<br /> sleep 1;<br /> rm -f $C_PID;<br /> sleep 1;<br /> screen -dmS wowLogon nice $C_SRV;<br /> # On détruit les eventuelles sessions &quot;mortes&quot;<br /> screen -wipe;<br /> echo &quot;$(date) lancé.&quot;;<br /> else<br /> echo &quot;$(date) Processus déja démaré.&quot;;<br /> fi<br /> fi<br /> echo &quot;$(date) Analise complété.&quot;;<br /> done<br /> EOF</div></td></tr></tbody></table></div><p>On le rend executable:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ chmod +x launcher.sh</div></td></tr></tbody></table></div><li><h2>Allez, vite, on lance !</h2></li><p>A ce stade votre serveur est installé, il ne vous manque plus qu&#8217;as ajouter un utilisateur, pour ça,<br /> la solution la plus simple: phpmyadmin. vous pouvez inserer dans la table &#8216;logon&#8217; vos joueurs.</p><p>ça y est, le moment tant attendu est arrivé, on lance le schmilblik:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ screen -dmS wowsvr ./launcher.sh</div></td></tr></tbody></table></div><li><h2>Page web</h2></li><p>En option, voila un petit script php qui permetra au joueurs de s&#8217;inscrire sur votre serveur !<br /> Il est tard j&#8217;en ai un peu marre, alors je vous lache ça en vrac:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># aptitude install apache2 php5</div></td></tr></tbody></table></div><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># cd /var/www/</div></td></tr></tbody></table></div><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># wget http://www.crashdump.fr/~polux/wow-spora/spora-server-page.rar</div></td></tr></tbody></table></div><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># unrar x spora-server-page.rar</div></td></tr></tbody></table></div><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># vim index.php</div></td></tr></tbody></table></div><p>Configurez.. enregistrez.. ça roule !<br /> rendez vous sur http://adresse-de-votre-serveur/</p><p><strong>N&#8217;hésitez pas a commenter le tutoriel si vous avez eu des galères, des trucs-qui-marchent-pas ou simplement un merci ? ça fait toujours plaisir, pour moi et pour ceux qui aurais le même souci :)</strong></p> ]]></content:encoded> <wfw:commentRss>http://www.crashdump.fr/tout-et-rien/creer-son-serveur-world-of-warcraft-prive-avec-ascentlinux-rev2-150/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>[Video] Publicité Linux</title><link>http://www.crashdump.fr/tout-et-rien/video-publicite-linux-107/</link> <comments>http://www.crashdump.fr/tout-et-rien/video-publicite-linux-107/#comments</comments> <pubDate>Mon, 31 Mar 2008 12:16:08 +0000</pubDate> <dc:creator>Crashdump</dc:creator> <category><![CDATA[Tout-et-Rien]]></category> <category><![CDATA[drole]]></category> <category><![CDATA[gag]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[Publicité]]></category><guid isPermaLink="false">http://blog.crashdump.fr/index.php/2008/03/31/video-publicite-linux/</guid> <description><![CDATA[Voici une pub qui m&#8217;as bien fait rire.]]></description> <content:encoded><![CDATA[<p>Voici une pub qui m&#8217;as bien fait rire.</p><p><object width="425" height="335"><param name="movie" value="http://www.dailymotion.com/swf/x1y7uw"></param><param name="allowfullscreen" value="true"></param> <embed src="http://www.dailymotion.com/swf/x1y7uw" type="application/x-shockwave-flash" width="425" height="335" allowfullscreen="true"></embed></object></p> ]]></content:encoded> <wfw:commentRss>http://www.crashdump.fr/tout-et-rien/video-publicite-linux-107/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>IfTop, Utilisation de la BP d&#8217;un serveur en temp réel</title><link>http://www.crashdump.fr/reseaux/iftop-utilisation-de-la-bp-dun-serveur-en-temp-reel-42/</link> <comments>http://www.crashdump.fr/reseaux/iftop-utilisation-de-la-bp-dun-serveur-en-temp-reel-42/#comments</comments> <pubDate>Mon, 27 Aug 2007 12:35:59 +0000</pubDate> <dc:creator>Crashdump</dc:creator> <category><![CDATA[Réseaux]]></category> <category><![CDATA[bande passante]]></category> <category><![CDATA[iftop]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[monitoring]]></category> <category><![CDATA[network]]></category> <category><![CDATA[network monitoring]]></category> <category><![CDATA[Paul Warren]]></category><guid isPermaLink="false">http://blog.nexus-6.fr/?p=42</guid> <description><![CDATA[Vous souhaitez voir le trafic de votre serveur en temps réel ? iftop est là pour vous ! iftop Connectez vous en ssh sur votre serveur Installez un paquet supplémentaire ( iftop ) 1apt-get install iftop Ensuite listez vos interfaces réseau: 1ifconfig Vous renvoie: eth0, eth1, etc&#8230; Ensuite pour monitorer votre interface comme ceci: 1iftop [...]]]></description> <content:encoded><![CDATA[<p><em>Vous souhaitez voir le trafic de votre serveur en temps réel ? iftop est là pour vous !</em></p><h2><li>iftop</li></h2><p>Connectez vous en ssh sur votre serveur<br /> Installez un paquet supplémentaire ( iftop )</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apt-get install iftop</div></td></tr></tbody></table></div><p>Ensuite listez vos interfaces réseau:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ifconfig</div></td></tr></tbody></table></div><p>Vous renvoie: eth0, eth1, etc&#8230;<br /> Ensuite pour monitorer votre interface comme ceci:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">iftop -i eth0</div></td></tr></tbody></table></div><p>Les options de iftop:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">iftop: display bandwidth usage on an interface by host<br /> Synopsis: iftop -h | -npbBP -i interface -f filter code -N net/mask<br /> &nbsp; -h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;display this message<br /> &nbsp; -n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;don't do hostname lookups<br /> &nbsp; -N &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;don't convert port numbers to services<br /> &nbsp; -p &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;run in promiscuous mode (show traffic between other<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hosts on the same network segment)<br /> &nbsp; -b &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;don't display a bar graph of traffic<br /> &nbsp; -B &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Display bandwidth in bytes<br /> &nbsp; -i interface &nbsp; &nbsp; &nbsp; &nbsp;listen on named interface<br /> &nbsp; -f filter code &nbsp; &nbsp; &nbsp;use filter code to select packets to count<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (default: none, but only IP packets are counted)<br /> &nbsp; -F net/mask &nbsp; &nbsp; &nbsp; &nbsp; show traffic flows in/out of network<br /> &nbsp; -P &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;show ports as well as hosts<br /> &nbsp; -m limit &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sets the upper limit for the bandwidth scale<br /> &nbsp; -c config file &nbsp; &nbsp; &nbsp;specifies an alternative configuration file<br /> iftop, copyright (c) 2002 Paul Warren &lt;pdw@ex-parrot.com&gt; and contributors</div></td></tr></tbody></table></div> ]]></content:encoded> <wfw:commentRss>http://www.crashdump.fr/reseaux/iftop-utilisation-de-la-bp-dun-serveur-en-temp-reel-42/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>[En] How to restore a hacked Linux server</title><link>http://www.crashdump.fr/securite/en-how-to-restore-a-hacked-linux-server-13/</link> <comments>http://www.crashdump.fr/securite/en-how-to-restore-a-hacked-linux-server-13/#comments</comments> <pubDate>Mon, 04 Jun 2007 19:20:43 +0000</pubDate> <dc:creator>Crashdump</dc:creator> <category><![CDATA[Sécurité]]></category> <category><![CDATA[attacker]]></category> <category><![CDATA[Dell]]></category> <category><![CDATA[detection tools]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[Linux system]]></category> <category><![CDATA[rootkit detections tools]]></category> <category><![CDATA[vulnerable web application]]></category> <category><![CDATA[web application]]></category> <category><![CDATA[web server]]></category> <category><![CDATA[web service]]></category> <category><![CDATA[web user]]></category><guid isPermaLink="false">http://blog.aemeth.org/?p=13</guid> <description><![CDATA[Copié depuis le site: http://www.ducea.com/2006/07/17/how-to-restore-a-hacked-linux-server/ Every sysadmin will try its best to secure the system/s he is managing. Hopefully you never had to restore your own system from a compromise and you will not have to do this in the future. Working on several projects to restore a compromised Linux system for various clients, I [...]]]></description> <content:encoded><![CDATA[<p><strong>Copié depuis le site: <a rel="nofollow" href="http://www.ducea.com/2006/07/17/how-to-restore-a-hacked-linux-server/">http://www.ducea.com/2006/07/17/how-to-restore-a-hacked-linux-server/</a></strong></p><p>Every sysadmin will try its best to secure the system/s he is managing. Hopefully you never had to restore your own system from a compromise and you will not have to do this in the future. Working on several projects to restore a compromised Linux system for various clients, I have developed a set of rules that others might find useful in similar situations. The type of hacks encountered can be very variate and you might see very different ones than the one I will present, or I have seen live, but even so, this rules might be used as a starting point to develop your own recovery plan.</p><p>In most cases if you have a system compromise at root level, you will hear that you have to fully reinstall the system and start fresh because it will be very hard to remove all the hidden files the attacker has placed on the system. This is completely true and if you can afford to do this then you should do it. Still even in this case the compromised system contains valuable information that can be used to understand the attack and prevent it in the future.</p><p><strong>Here is a short overview of the steps that I will present:</strong></p><p> * Don’t panic. Keep your calm and develop a plan of actions<br /> * Disconnect the system from the network<br /> * Discover the method used to compromise the system<br /> * Stop all the attacker scripts and remove his files<br /> * Restore not affected services<br /> * Fix the problem that caused the compromise<br /> * Restore the affected services<br /> * Monitor the system</p><p><strong>Don’t panic. Keep your calm and develop a plan of actions.</strong><br /> <span id="more-13"></span><br /> Ok. You have just found out that you have to restore a hacked system. My first suggestion is to remain calm. Don’t rush and do something you will regret later. Why? Of course you will have to take action as soon as possible, but you can assume that the compromise is probably active for some time and if you act in second 1 or minute 10 this will probably not make much of a difference. If you have experience with such situations and have a proper plan in your mind, go for it, and don’t waste any time. If not, just relax, take 5 minutes to think about what you should do and how to solve this problem.<br /> Example of bad actions during this time: you will rush and kill all the running scripts the attacker has launched and then have a timeout when you will think what to do next… In this time the attacker might see you have discovered him (for example from his irc bot, etc.) and might become upset and clean up the system for you…<br /> Of course you should not go on with your planned trip and take care of this when you get back, I am just saying to use 5-10 minutes to think on this and develop a short action plan. There should be no timeout in your actions and you should always know what is the next step.</p><p><strong>Disconnect the system from the network</strong></p><p>This might not always be possible. But if you have physical access to the system or even if you are remotely on a system in a datacenter that provides a way to connect from a console (either a regular remote console, or a KVM, or a DRAC card in Dell servers, etc.), then this should be the next step. Connect to the remote console and bring down the network interface.<br /> If you don’t have a remote console, here are some other ideas: you might be able to rent a KVM for a limited time from your datacenter, or you might have to write some iptables rules to block any kind of access besides your own IP.<br /> After this your system will appear down to everyone, including the attacker that will see that the system is completely down.<br /> Discover the method used to compromise the system</p><p>This step in my opinion is the most important one and you should not proceed any further until you have a proper answer to the question: “How did the attacker get in?” This step will be probably the most time consuming as the type of attacks can be quite variate. Still if you don’t find out how the attacker got in, then you will risk that you place the system online and he will be able to compromise the system in a matter of minutes. And this time he might not be so nice and you will not have anything to restore… So even if there is not a general method for this, here are some ideas to get you started:</p><p><em>Depending from what tools you have already configured, you need to identify the files uploaded on the system:</em></p><p> * if you have a system like tripwire configured use it to find out what files where added/changed.<br /> * if you don’t have any such system installed, you might have to use the find command to search for the files newer than x days that were added to the system (also changed files in the respective interval).</p><p><em>Who owns the uploaded files?</em></p><p> * finding out the owner of the files will probably show you what application was used to get in. For example files uploaded as the web user will indicate that the web service was used to get in.</p><p><em>Investigate the uploaded files.</em></p><p> * the files that were uploaded on the system might provide valuable information about the attack. For example the attacker might use the same exploit to attack other systems from your compromised server. This can quickly show you what exploit he is using.</p><p><em>Get as much information from the running scripts launched by the attacker.</em></p><p> * as you have seen I have not recommended to stop yet the running scripts that the attacker might have launched. Why? Because they contain invaluable information to identify the attack. Use lsof on them (lsof -p PID) to see useful details. Where are they located? what user owns them? You might find the source of the attack from this information.</p><p><em>Use Rootkit detection tools.</em></p><p> * you might want to run some rootkit detections tools like rkhunter or chkrootkit to quickly identify common attacks.</p><p><em>Investigate system logs.</em></p><p> * with the information gathered by now you might reduce the size of the log information you have to investigate.</p><p>Hopefully you have found the source of the attack by now. Again this is very dependent of the type of attack. The most common one you might see these days is an exploit using a vulnerable web application and an attacker that will launch various scripts (irc bots, scanning tools, attacks on other systems, etc.). Still you might see something different like an attacker not launching any script, loading kernel modules to hide its tracks, to make it more difficult to identify or even see the compromise.</p><p><strong>Stop all the attacker scripts and remove his files</strong></p><p>Once you have identified the cause of the attack you can safely kill all the running scripts launched by the attacker and remove all his files (save them in a different location for further investigation). At this point we no longer need the scripts running as we got the information we could find from them. The system is still unavailable at this point and no service is available to the world.</p><p>Don’t forget to clean-up also the locations that the attacker might have entered to start his scripts on system reboot. Look in init scripts, rc.local, cron tabs for this.</p><p><strong>Restore not affected services</strong></p><p>Once we know the service used for the attack we can stop it and restore the network connection and all the unaffected services the system might provide. For example if the web server was used to get in, we can stop it, and restore other services like mail, dns, to minimize the downtime of the system.</p><p><strong>Fix the problem that caused the compromise</strong></p><p>Before starting the service used to compromise the system you should fix the problem so this will not happen again once the service is open to the public… Depending on the problem this might involve: patching a vulnerable daemon, upgrading a vulnerable web application (or temporary disable it), writing some special rulers to block it (for ex. mod_security rules might help in case of no patch available for a web application), etc.<br /> Restore the affected services</p><p><em>Once you have fixed the problem you can restart the service used to get inside the system.</em></p><p><strong>Monitor the system</strong></p><p>Now is the time to monitor closely the system and see if the fix you have implemented is working. Most certainly the attacker will try to get in again as he will see he has ‘lost’ the system. If you notice any problem stop the service at once and reiterate again to the step to fix the problem (stop the service, fix it, restore it).</p><p><strong>Conclusion</strong></p><p>These steps are obviously not usable all the time because of the variety of attacks you might encounter, but they can be used as a baseline to develop your own plan of actions. Again in such situations, keep your calm, don’t rush, and work to restore the system based on a clear set of steps.<br /> If you had similar experiences please feel free to share your own tips to help others that might find themselves in such a situation.</p> ]]></content:encoded> <wfw:commentRss>http://www.crashdump.fr/securite/en-how-to-restore-a-hacked-linux-server-13/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Bash &#8230; #1</title><link>http://www.crashdump.fr/debian/le-bash-1-8/</link> <comments>http://www.crashdump.fr/debian/le-bash-1-8/#comments</comments> <pubDate>Tue, 03 Apr 2007 18:31:10 +0000</pubDate> <dc:creator>Crashdump</dc:creator> <category><![CDATA[Debian]]></category> <category><![CDATA[Bash]]></category> <category><![CDATA[cours]]></category> <category><![CDATA[date]]></category> <category><![CDATA[export]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[prompt]]></category> <category><![CDATA[tumbnail]]></category> <category><![CDATA[YELLOW]]></category><guid isPermaLink="false">http://blog.aemeth.org/?p=8</guid> <description><![CDATA[Toutes les distributions Linux ont étés avant tout concues de façon a etre utilisée via un shell, et dans mon utilisation quotidienne la ligne de commande est un outil indispensable&#8230; d&#8217;autant plus que pour certaines tâches , il n&#8217;y a pas plus rapide ! Ce billet est le premier d&#8217;une série sur la customisation et [...]]]></description> <content:encoded><![CDATA[<p>Toutes les distributions Linux ont étés avant tout concues de façon a etre utilisée via un shell, et dans mon utilisation quotidienne la ligne de commande est un outil indispensable&#8230; d&#8217;autant plus que pour certaines tâches , il n&#8217;y a pas plus rapide ! Ce billet est le premier d&#8217;une série sur la customisation et l&#8217;utilisation de Bash.</p><h2><li>Le Prompt</li></h2><p>Le prompt est la première chose que l&#8217;on voit lors de l&#8217;utilisation du shell, il peut donc mettre en valeur des informations importantes. Il doit donc indiquer, au mininum ces information importantes:<br /> - La machine sur laquelle on est loggué<br /> - Le login<br /> - Le répertoire courant<br /> Pour cela j&#8217;utilise la configuration suivante soit dans le fichier /etc/bash.bashrc (tous les utilisateurs) soit dans mon ~/.bashrc (l&#8217;utilisateur courant) :<br /> <span id="more-8"></span></p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># couleurs<br /> C_RED=&quot;\[\e[1;31m\]&quot;<br /> C_BLUE=&quot;\[\e[1;34m\]&quot;<br /> C_GRAY=&quot;\[\e[1;30m\]&quot;<br /> C_WHITE=&quot;\[\e[1;37m\]&quot;<br /> C_YELLOW=&quot;\[\e[1;33m\]&quot;<br /> C_DEF=&quot;\[\033[0m\]&quot;<br /> mUID=`id -u`<br /> MACHINE=&quot;Lorien&quot;<br /> IP=&quot;192.168.0.243&quot;<br /> if [ &quot;$mUID&quot; = &quot;0&quot; ] ; then<br /> &nbsp; &nbsp;PS1=&quot;${C_YELLOW}&gt;${C_DEF} ${C_RED}\u${C_DEF}@${MACHINE}${C_YELLOW} [${C_DEF}$IP${C_YELLOW}]${C_DEF}:\w${C_RED}#${C_DEF} &quot;<br /> &nbsp; &nbsp;PS2=&quot;${C_RED}&gt;${C_DEF} &nbsp;&quot;<br /> else<br /> &nbsp; &nbsp;PS1=&quot;${C_YELLOW}&gt;${C_DEF} ${C_BLUE}\u${C_DEF}@${MACHINE}${C_YELLOW} [${C_DEF}$IP${C_YELLOW}]${C_DEF}:\w${C_BLUE}\$ ${C_DEF}&quot;<br /> &nbsp; &nbsp;PS2=&quot;${C_BLUE}&gt;${C_DEF} &nbsp;&quot;<br /> fi<br /> export PS2<br /> export PS1</div></td></tr></tbody></table></div><p>Cette configuration fait en sorte d&#8217;avoir un prompt bleu, jaune et blanc pour un utilisateur normal et rouge, jaune et blanc pour l&#8217;utilisateur root attirant ainsi mon attention sur le fait qu&#8217;en root, on ne tape par n&#8217;importe quoi&#8230; Il m&#8217;indique aussi le nom de la machine ainsi que son adresse IP. Ce qui donne :</p><p><a href='http://www.crashdump.fr/wp-content/uploads/2008/02/prompt.jpg' title='PromptPerso' rel='lightbox'><img src='http://www.crashdump.fr/wp-content/uploads/2008/02/prompt.thumbnail.jpg' alt='PromptPerso' /></a></p><p>Pour que vous puissiez customiser votre prompt a votre gout, voiçi la liste des codes de couleurs et de correspondance.</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:450px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;strong&gt;Les fonctions communes:&lt;/strong&gt;<br /> &nbsp; &nbsp; \d# La date<br /> &nbsp; &nbsp; \h# Nom de la machine<br /> &nbsp; &nbsp; \\# Un backslash<br /> &nbsp; &nbsp; \r# Retour à la ligne<br /> &nbsp; &nbsp; \t# L’heure<br /> &nbsp; &nbsp; \u# Utilisateur<br /> &nbsp; &nbsp; \v# Version du Bash<br /> &nbsp; &nbsp; \w# Repertoire courant complet<br /> &nbsp; &nbsp; \W# Repertoire courant<br /> &nbsp; &nbsp; \$# Le symbole $<br /> &lt;strong&gt;Les couleurs:&lt;/strong&gt;<br /> &nbsp; &nbsp; Noir:0;30<br /> &nbsp; &nbsp; Rouge:0;31<br /> &nbsp; &nbsp; Vert:0;32<br /> &nbsp; &nbsp; Marron:0;33<br /> &nbsp; &nbsp; Bleu:0;34<br /> &nbsp; &nbsp; Violet:0;35<br /> &nbsp; &nbsp; Cyan:0;36<br /> &nbsp; &nbsp; Gris clair:0;37<br /> &nbsp; &nbsp; Gris:1;30<br /> &nbsp; &nbsp; Rose:1;31<br /> &nbsp; &nbsp; Vert clair:1;32<br /> &nbsp; &nbsp; Marron clair:1;33<br /> &nbsp; &nbsp; Bleu clair:1;34<br /> &nbsp; &nbsp; Violet clair:1;35<br /> &nbsp; &nbsp; Cyan clair:1;36<br /> &nbsp; &nbsp; Blanc:1;37</div></td></tr></tbody></table></div><h2><li>Le titre des terminaux graphiques</li></h2><p>De la même manière que le prompt, le titre des terminaux est très utile pour se repèrer lorsqu&#8217;on utilise Xorg. Dans un terminal, il est possible de changer ce titre de manière dynamique avec un simple echo, il suffit alors d&#8217;utiliser la variable PROMPT_COMMAND pour stocker une commande que le shell éxécutera à chaque affichage du prompt.</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">case $TERM in<br /> xterm*)<br /> &nbsp; PROMPT_COMMAND='echo -ne &quot;\033]0;${USER}@${MACHINE}[$IP]: ${PWD}\007&quot;'<br /> &nbsp; echo -ne &quot;\033]0;${USER}@${MACHINE}[$IP]: ${PWD}\007&quot;<br /> &nbsp; &nbsp;;;<br /> &nbsp;*)<br /> &nbsp; setterm -blength 0<br /> &nbsp; ;;<br /> esac</div></td></tr></tbody></table></div><p>Avec ces quelques lignes, les terminaux affiche la même chose que le prompt dans leur titre (sans les couleurs) lorsque le type de terminal commence par &laquo;&nbsp;xterm&nbsp;&raquo; (ce qui est le cas avec xterm mais aussi gnome-terminal ).</p><p>À noter que la seconde partie du case permet de supprimer le beep très énervant beep lorsqu&#8217;on est en console sans Xorg.</p> ]]></content:encoded> <wfw:commentRss>http://www.crashdump.fr/debian/le-bash-1-8/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: www.crashdump.fr @ 2012-02-04 20:07:04 by W3 Total Cache -->
