<?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; Debian</title>
<atom:link href="http://www.crashdump.fr/debian/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=3.3.2</generator>
<item>
<title>nscd: prune_cache: Assertion `dh-&gt;usable&#8217;</title>
<link>http://www.crashdump.fr/debian/nscd-prune_cache-assertion-dh-usable-858/</link>
<comments>http://www.crashdump.fr/debian/nscd-prune_cache-assertion-dh-usable-858/#comments</comments>
<pubDate>Fri, 25 Jun 2010 09:06:06 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<guid isPermaLink="false">https://www.crashdump.fr/?p=858</guid>
<description>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2010/06/bug.jpeg" class="attachment-featured-image wp-post-image" alt="bug" title="bug" /></p><br />Comme vous le savez, tous les gros bugs arrivent toujours le vendredi&#8230; celui-ci n&#8217;as pas dérogé à la règle. Mise en situation: Un des serveurs mail que j&#8217;administre utilise un serveur LDAP distant pour l&#8217;authentification, le réseau entre les deux étant très sollicité, j&#8217;ai donc tout naturellement installé le service NSCD qui permet de mettre [...]]]>
</description>
<content:encoded>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2010/06/bug.jpeg" class="attachment-featured-image wp-post-image" alt="bug" title="bug" /></p><br /><p><em>Comme vous le savez, tous les gros bugs arrivent toujours le vendredi&#8230; celui-ci n&#8217;as pas dérogé à la règle.</em></p>
<p>Mise en situation: Un des serveurs mail que j&#8217;administre utilise un serveur LDAP distant pour l&#8217;authentification, le réseau entre les deux étant très sollicité, j&#8217;ai donc tout naturellement installé le service NSCD qui permet de mettre en cache les requêtes des services de noms les plus courants. Ce setup a fonctionné à merveille pendant un an&#8230;</p>
<p>Ce matin, j&#8217;ai eu des remontés de panne d&#8217;utilisateurs qui essuyaient des échecs (&laquo;&nbsp;Auth failed&nbsp;&raquo;) lors du relevé quotidien de leurs mail, alors que d&#8217;autres n&#8217;avaient aucun problème. On pouvait noter cet erreur dans les logs:</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">could not identify user <span style="color: #7a0874; font-weight: bold;">&#40;</span>from getpwnam NSCD<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$user</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div></td></tr></tbody></table></div>
<p>Après moultes recherches, infructueuses.. (n&#8217;oublions pas qu&#8217;il sagit de la panne <del datetime="2010-06-25T08:24:00+00:00">chiante</del> embêtante du vendredi) .. je me rends compte du fait que le service de cache nscd est au tas (et que bien évidemment je n&#8217;avais reçu aucune alerte. Vendredi, tout ça&#8230;)</p>
<p>Démarrage en mode debug du daemon:</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: #666666; font-style: italic;"># nscd -d</span><br />
...<br />
nscd: cache.c:<span style="color: #000000;">384</span>: prune_cache: Assertion <span style="color: #ff0000;">'dh-&gt;usable'</span> failed.</div></td></tr></tbody></table></div>
<p>Invalidons le cache:</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: #666666; font-style: italic;"># nscd -i hosts</span><br />
<span style="color: #666666; font-style: italic;"># nscd -i passwd</span><br />
<span style="color: #666666; font-style: italic;"># nscd -i group</span></div></td></tr></tbody></table></div>
<p>Le service s&#8217;écroule au bout de 30s de travail&#8230; Passons aux choses <del datetime="2010-06-25T08:24:00+00:00">sérieuses</del> brutales.</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"><span style="color: #666666; font-style: italic;"># rm -f /var/cache/nscd/*</span><br />
<span style="color: #666666; font-style: italic;"># /etc/init.d/nscd start</span></div></td></tr></tbody></table></div>
<p>Le tour est joué ! Trois heures que les choses ont repris, la chose est stable.</p>
<p><em>Pour information un bug est ouvert sur le bugtrack et il sagit de la version:</em></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"><span style="color: #666666; font-style: italic;"># nscd -V</span><br />
nscd <span style="color: #7a0874; font-weight: bold;">&#40;</span>GNU libc<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">2.7</span></div></td></tr></tbody></table></div>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/nscd-prune_cache-assertion-dh-usable-858/feed/</wfw:commentRss>
<slash:comments>2</slash:comments>
</item>
<item>
<title>Tips: Man pages en couleurs&#8230;</title>
<link>http://www.crashdump.fr/debian/tips-man-pages-en-couleurs-812/</link>
<comments>http://www.crashdump.fr/debian/tips-man-pages-en-couleurs-812/#comments</comments>
<pubDate>Sat, 24 Apr 2010 11:29:28 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[color]]>
</category>
<category>
<![CDATA[couleur]]>
</category>
<category>
<![CDATA[man pages]]>
</category>
<category>
<![CDATA[most]]>
</category>
<category>
<![CDATA[shell]]>
</category>
<category>
<![CDATA[tips]]>
</category>
<guid isPermaLink="false">http://www.crashdump.fr/?p=812</guid>
<description>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2010/04/man_ping_color.jpg" class="attachment-featured-image wp-post-image" alt="man_ping_color" title="man_ping_color" /></p><br />Aujourd&#8217;hui sur IRC j&#8217;ai eu droit a: &#171;&#160;un PDF c&#8217;est mieux que des manpages toutes pourries dans un shell.&#160;&#187; Oui, mais non ! Il existe un moyen simple de colorer joliment vos manpages et donc de les rendre beaucoup plus agréable/pratiques. Vos manpages en couleurs avec most: 1# aptitude install most 1$ export MANPAGER=&#34;/usr/bin/most -s&#34; [...]]]>
</description>
<content:encoded>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2010/04/man_ping_color.jpg" class="attachment-featured-image wp-post-image" alt="man_ping_color" title="man_ping_color" /></p><br /><p><em>Aujourd&#8217;hui sur IRC j&#8217;ai eu droit a: &laquo;&nbsp;un PDF c&#8217;est mieux que des manpages toutes pourries dans un shell.&nbsp;&raquo;<br />
</em><em>Oui, mais non ! Il existe un moyen simple de colorer joliment vos manpages et donc de les rendre beaucoup plus agréable/pratiques.</em></p>
<h2>Vos manpages en couleurs avec most:</h2>
<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: #666666;"># </span><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> most</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: #666666;">$ </span><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MANPAGER</span>=<span style="color: #ff0000;">&quot;/usr/bin/most -s&quot;</span></div></td></tr></tbody></table></div>
<p>Ce qui nous donne:</p>
<p style="text-align: center;"><a href="http://www.crashdump.fr/wp-content/uploads/2010/04/man_ping_color1.png"><img class="size-thumbnail wp-image-816 aligncenter" title="man_ping_color" src="http://www.crashdump.fr/wp-content/uploads/2010/04/man_ping_color1-430x125.png" alt="" width="430" height="125" /></a></p>
<h2>Pour le supprimer:</h2>
<p>Rien de plus simple, on supprime la variable et on efface toutes traces de most.</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: #666666;">$ </span><span style="color: #7a0874; font-weight: bold;">unset</span> MANPAGER</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: #666666;"># </span><span style="color: #c20cb9; font-weight: bold;">aptitude</span> remove most <span style="color: #660033;">--purge</span></div></td></tr></tbody></table></div>
<h2>One more thing:</h2>
<p>On me souffle dans l&#8217;oreillette qu&#8217;il est possible de faire la même chose avec less:</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 /></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: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_mb</span>=$<span style="color: #ff0000;">'\E[01;31m'</span><br />
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_md</span>=$<span style="color: #ff0000;">'\E[01;31m'</span><br />
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_me</span>=$<span style="color: #ff0000;">'\E[0m'</span><br />
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_se</span>=$<span style="color: #ff0000;">'\E[0m'</span><br />
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_so</span>=$<span style="color: #ff0000;">'\E[01;44;33m'</span><br />
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_ue</span>=$<span style="color: #ff0000;">'\E[0m'</span><br />
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LESS_TERMCAP_us</span>=$<span style="color: #ff0000;">'\E[01;32m'</span><br />
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PAGER</span>=<span style="color: #ff0000;">'less'</span></div></td></tr></tbody></table></div>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/tips-man-pages-en-couleurs-812/feed/</wfw:commentRss>
<slash:comments>7</slash:comments>
</item>
<item>
<title>Got error 28 from storage engine query: SELECT * FROM &#8230;</title>
<link>http://www.crashdump.fr/debian/got-error-28-from-storage-engine-query-select-from-717/</link>
<comments>http://www.crashdump.fr/debian/got-error-28-from-storage-engine-query-select-from-717/#comments</comments>
<pubDate>Tue, 16 Jun 2009 16:49:52 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[mysql]]>
</category>
<guid isPermaLink="false">http://www.crashdump.fr/?p=717</guid>
<description>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2009/06/disquette.jpg" class="attachment-featured-image wp-post-image" alt="disquette" title="disquette" /></p><br />Grand coup de stress pour moi ce soir ! En effet, les requêtes SQL des sites hébergés sur cette machine n&#8217;avaient plus aucun sens: drop, réponses érronées et j&#8217;en passe.. en jetant un oeil dans les logs j&#8217;ai trouvé ça: 123&#91;Tue Jun 16 18:05:28 2009&#93; &#91;error&#93; &#91;client x.x.x.x&#93; Got error 28 from storage engine query: [...]]]>
</description>
<content:encoded>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2009/06/disquette.jpg" class="attachment-featured-image wp-post-image" alt="disquette" title="disquette" /></p><br /><p>Grand coup de stress pour moi ce soir ! En effet, les requêtes SQL des sites hébergés sur cette machine n&#8217;avaient plus aucun sens: drop, réponses érronées et j&#8217;en passe.. en jetant un oeil dans les logs j&#8217;ai trouvé ça:</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: #7a0874; font-weight: bold;">&#91;</span>Tue Jun <span style="color: #000000;">16</span> <span style="color: #000000;">18</span>:05:<span style="color: #000000;">28</span> <span style="color: #000000;">2009</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>error<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>client x.x.x.x<span style="color: #7a0874; font-weight: bold;">&#93;</span> Got error <span style="color: #000000;">28</span> from storage engine query: SELECT <span style="color: #000000; font-weight: bold;">*</span> FROM ...<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Tue Jun <span style="color: #000000;">16</span> <span style="color: #000000;">18</span>:06:<span style="color: #000000;">58</span> <span style="color: #000000;">2009</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>error<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>client x.x.x.x<span style="color: #7a0874; font-weight: bold;">&#93;</span> Got error <span style="color: #000000;">28</span> from storage engine query: SELECT <span style="color: #000000; font-weight: bold;">*</span> FROM ...<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Tue Jun <span style="color: #000000;">16</span> <span style="color: #000000;">18</span>:07:<span style="color: #000000;">18</span> <span style="color: #000000;">2009</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>error<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>client x.x.x.x<span style="color: #7a0874; font-weight: bold;">&#93;</span> Got error <span style="color: #000000;">28</span> from storage engine query: SELECT <span style="color: #000000; font-weight: bold;">*</span> FROM ...</div></td></tr></tbody></table></div>
<p>Il se trouve que cette erreur arrive quand MySQL n&#8217;a plus d&#8217;espace disque disponible&#8230; En effet, le script &#8211; buggy &#8211; ne supprimais plus les vieux backups lors de la création de nouveaux. J&#8217;en suis vite arrivé a saturer ma partition temporaire. Erreur de débutant !</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;">df</span> <span style="color: #660033;">-h</span><br />
Sys. de fich. Tail. Occ. Disp. <span style="color: #000000; font-weight: bold;">%</span>Occ. Monté sur<br />
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md1 10G 10G <span style="color: #000000;">7</span>,3G <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>tmp</div></td></tr></tbody></table></div>
<p>Pour me rendre d&#8217;autant plus utile, voici un petit script pour monitorer l&#8217;espace utilisé sur vos disque, il enverra un mail en cas d&#8217;utilisation d&#8217;une partition a plus de 95%.</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: #666666; font-style: italic;">#!/bin/sh</span><br />
<span style="color: #c20cb9; font-weight: bold;">df</span> <span style="color: #660033;">-H</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-vE</span> <span style="color: #ff0000;">'^[a-zA-Z]|tmpfs|cdrom|udev'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $5 &quot; &quot; $1 }'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> line;<br />
<span style="color: #000000; font-weight: bold;">do</span><br />
<span style="color: #666666; font-style: italic;">#echo $line</span><br />
<span style="color: #007800;">usep</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$line</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $1}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span><span style="color: #ff0000;">'%'</span> <span style="color: #660033;">-f1</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #007800;">partition</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$line</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2 }'</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$usep</span> <span style="color: #660033;">-ge</span> <span style="color: #000000;">95</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Running out of space <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$partition</span> (<span style="color: #007800;">$usep</span>%)<span style="color: #000099; font-weight: bold;">\&quot;</span> on <span style="color: #007800;">$(hostname)</span> as on <span style="color: #007800;">$(date)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span><br />
mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Alert: Almost out of disk space <span style="color: #007800;">$usep</span>%&quot;</span> alertme<span style="color: #000000; font-weight: bold;">@</span>crashdump.fr<br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">done</span></div></td></tr></tbody></table></div>
<p>A ajouter dans vos crontabs:</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;">*/</span><span style="color: #000000;">30</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>path-to-file<span style="color: #000000; font-weight: bold;">/</span>mail-warn-disk-usage.sh</div></td></tr></tbody></table></div>
<p>Sur ce, je peux reprendre un activité normale.. détendu !</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/got-error-28-from-storage-engine-query-select-from-717/feed/</wfw:commentRss>
<slash:comments>1</slash:comments>
</item>
<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>Serveur X distant sur Mac (FreeNX)</title>
<link>http://www.crashdump.fr/debian/serveur-x-distant-sur-mac-freenx-431/</link>
<comments>http://www.crashdump.fr/debian/serveur-x-distant-sur-mac-freenx-431/#comments</comments>
<pubDate>Tue, 11 Nov 2008 16:25:33 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Réseaux]]>
</category>
<category>
<![CDATA[FreeNX]]>
</category>
<category>
<![CDATA[Mac]]>
</category>
<category>
<![CDATA[NXFree]]>
</category>
<category>
<![CDATA[X distant]]>
</category>
<category>
<![CDATA[XDMCP]]>
</category>
<guid isPermaLink="false">http://www.crashdump.fr/?p=431</guid>
<description>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2008/11/Xfreenx.jpg" class="attachment-featured-image wp-post-image" alt="Xfreenx" title="Xfreenx" /></p><br />Suite au retours sur le tutoriel XDMCP, J&#8217;ai donc publié sa suite logique.. l&#8217;autre façon, plus adaptée au grand réseau Internet d&#8217;avoir accès à une session X distante. J&#8217;ai nommé NXFree. Le but de FreeNX est d’exporter un bureau graphique complet sur un poste distant en utilisant une bande passante minimum. FreeNX reposant entièrement sur [...]]]>
</description>
<content:encoded>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2008/11/Xfreenx.jpg" class="attachment-featured-image wp-post-image" alt="Xfreenx" title="Xfreenx" /></p><br /><p><em>Suite au retours sur le tutoriel XDMCP, J&#8217;ai donc publié sa suite logique.. l&#8217;autre façon, plus adaptée au grand réseau Internet d&#8217;avoir accès à une session X distante. J&#8217;ai nommé NXFree. Le but de FreeNX est d’exporter un bureau graphique complet sur un poste distant en utilisant une bande passante minimum. FreeNX reposant entièrement sur un serveur SSH, il faut également qu’un serveur SSH soit opérationnel sur le serveur. Ceci n&#8217;est une solution complètement libre.. mais simple.</em></p>
<li>
<h2>Ce dont vous avez besoin</h2>
</li>
<p><strong>Serveur Linux</strong></p>
<li>Les paquets ne sont pas fourni pour Debian, mais vous pouvez les télécharger sur plusieurs adresses. L’adresse officielle est la suivante: </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 />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">wget http://64.34.161.181/download/2.1.0/Linux-NoXft/nxclient_2.1.0-17_i386.deb<br />
wget http://64.34.161.181/download/2.1.0/Linux/nxnode_2.1.0-22_i386.deb<br />
wget http://64.34.161.181/download/2.1.0/Linux/FE/nxserver_2.1.0-22_i386.deb</div></td></tr></tbody></table></div>
<p>On aura aussi besoin de cette libraire:</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">wget http://ftp.fr.debian.org/debian/pool/main/g/gcc-2.95/libstdc++2.10-glibc2.2_2.95.4-27_i386.deb</div></td></tr></tbody></table></div>
<li>Il est aussi possible &#8211; et conseillé d&#8217;utiliser la version des dépôts de Ubuntu via APT (Merci coagul) !</li>
<p>Il faut donc ajouter la ligne suivante au fichier « /etc/apt/sources.list  » :</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">deb http://mirror2.ubuntulinux.nl/ dapper-seveas all</div></td></tr></tbody></table></div>
<p>Installer la clé gpg :</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"># gpg --keyserver subkeys.pgp.net --recv-keys 1135D466<br />
# gpg --export --armor 1135D466 | apt-key add -</div></td></tr></tbody></table></div>
<p>Mettre à jour la liste des paquets</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 update</div></td></tr></tbody></table></div>
<p><strong>Client Mac</strong>: <a rel="nofollow" href="http://www.nomachine.com/download-package.php?Prod_Id=64">Le client NX Free</a>.</p>
<li>
<h2>Installation</h2>
</li>
<p><strong>Si vous avez retenu le choix numéro 1, les paquets &laquo;&nbsp;officiels&nbsp;&raquo;</strong>, placez vous dans le répertoire ou vous avez téléchargé les fichiers ci dessus, puis:</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">dpkg -i libstdc++2.10-glibc2.2_2.95.4-27_i386.deb<br />
dpkg -i nxclient_2.1.0-17_i386.deb<br />
dpkg -i nxnode_2.1.0-22_i386.deb<br />
dpkg -i nxserver_2.1.0-22_i386.deb</div></td></tr></tbody></table></div>
<p><strong>Si vous avez retenu les choix des dépôts Ubuntu</strong>:</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 freenx</div></td></tr></tbody></table></div>
<p><em>A la question des clés, sélectionnez: &laquo;&nbsp;NoMachine Keys&nbsp;&raquo;.</em></p>
<p><strong>Gestion des clés</strong></p>
<p>Editez le fichier sshd_config:</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"># vim /etc/ssh/sshd_config</div></td></tr></tbody></table></div>
<p>Et assurez vous que l&#8217;utilisateur &laquo;&nbsp;nx&nbsp;&raquo; ai bien le droit de se connecter via ssh. Si vous avez défini un &laquo;&nbsp;AllowUser&nbsp;&raquo;.. sinon passez directement à 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">AllowUser nx utilisateur1 utilisateurX ...</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">/etc/init.d/sshd reload</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">nxsetup nxsetup --install --setup-nomachine-key</div></td></tr></tbody></table></div>
<p><em>Ici, si vous rencontrez une erreur du type: &laquo;&nbsp;ssh_exchange_identification: Connection closed by remote host&nbsp;&raquo;, Au lieu de chercher pendant une heure d&#8217;où viens le problème.. regardez tout d&#8217;abord votre /etc/hosts.deny.. pour voir si le loopback (127.0.0.1) n&#8217;y est pas interdit.. ça vous évitera une prise de tête sans noms..</em></p>
<li>
<h2>Utilisation</h2>
</li>
<p>Je ne vais pas vous la détailler tellement elle est simple.. amusez vous bien ;)</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/serveur-x-distant-sur-mac-freenx-431/feed/</wfw:commentRss>
<slash:comments>1</slash:comments>
</item>
<item>
<title>Serveur X Debian distant sur Mac (XDMCP)</title>
<link>http://www.crashdump.fr/debian/serveur-x-debian-distant-sur-mac-xdmcp-429/</link>
<comments>http://www.crashdump.fr/debian/serveur-x-debian-distant-sur-mac-xdmcp-429/#comments</comments>
<pubDate>Tue, 11 Nov 2008 14:37:59 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Réseaux]]>
</category>
<category>
<![CDATA[icewm]]>
</category>
<category>
<![CDATA[Mac]]>
</category>
<category>
<![CDATA[Session distante x11]]>
</category>
<category>
<![CDATA[X Debian]]>
</category>
<category>
<![CDATA[X11Forwarding]]>
</category>
<category>
<![CDATA[xdm]]>
</category>
<category>
<![CDATA[XDMCP]]>
</category>
<guid isPermaLink="false">http://www.crashdump.fr/?p=429</guid>
<description>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2008/11/Xdmcp.jpg" class="attachment-featured-image wp-post-image" alt="Xdmcp" title="Xdmcp" /></p><br />Autant vous le dire tout de suite, je ne n&#8217;aime pas les interfaces graphiques sur les serveurs.. d&#8217;ailleurs j&#8217;ai déjà emm** pas mal de monde avec mes idéos, ça bouffe de la mémoire et du réseau pour rien. Mais bon.. Je me trouve aujourd&#8217;hui confronté à un problème sur un de mes projets difficilement resolvable [...]]]>
</description>
<content:encoded>
<![CDATA[<p><img width="240" height="150" src="http://www.crashdump.fr/wp-content/uploads/2008/11/Xdmcp.jpg" class="attachment-featured-image wp-post-image" alt="Xdmcp" title="Xdmcp" /></p><br /><p><em>Autant vous le dire tout de suite, je ne n&#8217;aime pas les interfaces graphiques sur les serveurs.. d&#8217;ailleurs j&#8217;ai déjà emm** pas mal de monde avec mes idéos, ça bouffe de la mémoire et du réseau pour rien. Mais bon.. Je me trouve aujourd&#8217;hui confronté à un problème sur un de mes projets difficilement resolvable sinon en installant un serveur X sur mon serveur. Put** de capcha.<br />
Je vais donc essayer de vous expliquer, ici, comment mettre en place une liaison Serveur X linux déportée sur un mac.</em></p>
<p>ATTENTION, Suite à certain retours, je tiens a préciser que ce n&#8217;est pas la meilleure solution pour administrer un serveur hebergé sur le net. c&#8217;est une très bonne option en LOCAL, pour du DISTANT, ce n&#8217;est à utiliser que très ponctuellement. Pour ceux qui aurais besoin d&#8217;avoir accès aux application x d&#8217;une machine distante il existe NX. (<a rel="nofollow" href="http://www.nomachine.com/download-package.php?Prod_Id=64">avec son client Mac, ici</a>). <a href="http://www.crashdump.fr/tutoriels/serveur-x-distant-sur-mac-freenx-431/">J&#8217;essayerais de vous publier un tutoriel sur le sujet</a>, bientôt. Sur ce, amusez vous bien ;)</p>
<li>
<h2>Ce dont vous aurez besoin</h2>
</li>
<p><strong>Sur le serveur</strong>: xdm et un environnement graphique (j&#8217;ai choisi icewm pur sa légèreté, mais n&#8217;importe lequel fera l&#8217;affaire)</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 xdm icewm</div></td></tr></tbody></table></div>
<p><strong>Sur votre mac</strong>: il vous faudra installer X11, vous le trouverez sur le CD1 d&#8217;installation du système Tiger ou Léopard (avant, je ne sais pas.. Quelqu&#8217;un saurait me le dire ?). Cherchez &laquo;&nbsp;Optional Installs.mpkg&nbsp;&raquo; et sélectionnez X11 dans le menu.</p>
<p><strong>Configuration de Ssh</strong>:</p>
<p>Editez le fichier de configuration:</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">vim /etc/ssh/sshd_config</div></td></tr></tbody></table></div>
<p>Modifiez ces deux ligne:</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">X11Forwarding yes<br />
X11DisplayOffset 10</div></td></tr></tbody></table></div>
<p>Puis relancez 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">/etc/init.d/ssh reload</div></td></tr></tbody></table></div>
<p><strong>Configuration de xdm</strong></p>
<p>Editez le fichier de configuration:</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">vim /etc/X11/xdm/xdm-config</div></td></tr></tbody></table></div>
<p>Modifiez cette ligne (pour définir le port 177 en écoute)</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">DisplayManager.requestPort: &nbsp; &nbsp; 177</div></td></tr></tbody></table></div>
<p>Editez le fichier d&#8217;autorisation d&#8217;accès:</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">vim /etc/X11/xdm/Xaccess</div></td></tr></tbody></table></div>
<p>Décommentez la ligne suivante:</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">#* &nbsp; &nbsp;#any host can get a login window</div></td></tr></tbody></table></div>
<p><em>On sécurisera via iptables.</em></p>
<p><strong>Configuration de IPTables</strong>:</p>
<p>Ici on va ouvrir les ports nécessaires:</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">iptables -A input -p udp -s x.x.x.x --dport 177 -j ACCEPT<br />
iptables -A input -p tcp -s x.x.x.x --dport 6000:6015 -j ACCEPT</div></td></tr></tbody></table></div>
<p>Ici j&#8217;ai remplacé mon Ip par x.x.x.x, mettez la votre. (celle du Mac)</p>
<p>Pensez a ouvrir ces ports sur votre routeur local.. su vous en avez un !<br />
- Port 177/UDP (XDMCP)<br />
- Port 6000 à 6015 (X11)</p>
<p><strong>Utilisation</strong>:</p>
<p>Sur le Mac, ouvrez un terminal et tapez ceci (remplacez l&#8217;ip de mon serveur par celle du votre, ici c&#8217;est celle de crashdump.fr ;)):</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">xhost +88.191.68.9</div></td></tr></tbody></table></div>
<p>X11 devrait se lancer.. en attente d&#8217;un connexion.</p>
<p>Connectez vous ensuite sur votre Box linux en ssh, puis:</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">export DISPLAY=x.x.x.x:0.0</div></td></tr></tbody></table></div>
<p>Replacez le x.x.x.x par l&#8217;adresse Ip de votre Mac.</p>
<p>Il ne vous reste plus qu&#8217;a lancer l&#8217;application en question.. pour la voir apparaître sur votre mac ! Exemple:</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">xterm</div></td></tr></tbody></table></div>
<p>Et la magie opère ! ;)</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/serveur-x-debian-distant-sur-mac-xdmcp-429/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Vos logs en couleurs !</title>
<link>http://www.crashdump.fr/debian/vos-logs-en-couleurs-120/</link>
<comments>http://www.crashdump.fr/debian/vos-logs-en-couleurs-120/#comments</comments>
<pubDate>Mon, 18 Aug 2008 13:04:47 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Apache]]>
</category>
<category>
<![CDATA[colorise]]>
</category>
<category>
<![CDATA[couleur]]>
</category>
<category>
<![CDATA[daemon]]>
</category>
<category>
<![CDATA[exim]]>
</category>
<category>
<![CDATA[Html]]>
</category>
<category>
<![CDATA[log]]>
</category>
<category>
<![CDATA[logColorize]]>
</category>
<category>
<![CDATA[perl]]>
</category>
<category>
<![CDATA[squid]]>
</category>
<category>
<![CDATA[xferlog]]>
</category>
<guid isPermaLink="false">http://blog.crashdump.fr/?p=120</guid>
<description>
<![CDATA[Colorize est script Perl qui permet -par le biais d&#8217;expressions régulières- de mettre en couleur les logs de votre système favori. De plus il reconnais beaucoup de formats: daemon (formats standards), squid, apache (accès, erreurs), xferlog, exim, etc&#8230; Il reconnais beaucoup de choses: email, urls, taille, adresse, version, fichiers, services, protocoles.. et j&#8217;en passe. Et [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Colorize est script Perl qui permet -par le biais d&#8217;expressions régulières- de mettre en couleur les logs de votre système favori. De plus il reconnais beaucoup de formats: daemon (formats standards), squid, apache (accès, erreurs), xferlog, exim, etc&#8230;<br />
Il reconnais beaucoup de choses: email, urls, taille, adresse, version, fichiers, services, protocoles.. et j&#8217;en passe. Et comme ceci ne suffisait pas, il supporte les thèmes (plusieurs fichiers de configuration customisables) et peut enregistrer les logs modifiés en HTML (support du CSS).<br />
<span id="more-120"></span><br />
Malheureusement, le site de l&#8217;auteur est mort: <a rel="nofollow" href="http://nrg.martos.bme.hu/release/colorize/">http://nrg.martos.bme.hu/release/colorize/</a> alors voici la dernière version que j&#8217;ai pu obtenir (LogColorize 1.0.7): </p>
<p>http://misc.crashdump.fr/~polux/files/logcolorise-1.0.7.tar.gz</p>
<p>Pour l&#8217;installer, rien de plus simple:</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"># tar xvf logcolorise-1.0.7.tar.gz<br />
# mv logcolorise /usr/bin/</div></td></tr></tbody></table></div>
<p>Et enfin, pour en profiter:</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"># logcolorise /var/log/votreLogPrefere.log</div></td></tr></tbody></table></div>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/vos-logs-en-couleurs-120/feed/</wfw:commentRss>
<slash:comments>1</slash:comments>
</item>
<item>
<title>LDAP: &#171;&#160;bdb_db_open: unclean shutdown detected&#160;&#187;</title>
<link>http://www.crashdump.fr/debian/ldap-bdb_db_open-unclean-shutdown-detected-290/</link>
<comments>http://www.crashdump.fr/debian/ldap-bdb_db_open-unclean-shutdown-detected-290/#comments</comments>
<pubDate>Mon, 18 Aug 2008 10:07:41 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Réseaux]]>
</category>
<category>
<![CDATA[bdb_db_open]]>
</category>
<category>
<![CDATA[dbd]]>
</category>
<category>
<![CDATA[db_recover]]>
</category>
<category>
<![CDATA[ldap]]>
</category>
<category>
<![CDATA[Manitoba]]>
</category>
<category>
<![CDATA[slapd]]>
</category>
<category>
<![CDATA[unclean]]>
</category>
<guid isPermaLink="false">http://www.crashdump.fr/?p=290</guid>
<description>
<![CDATA[Lundi matin, une journée qui commence bien. Le service &#171;&#160;slapd&#160;&#187; étant arrêté, je me jette dans les logs et voilà ce que j&#8217;y trouve: 12bdb_db_open: unclean shutdown detected; attempting recovery. bdb_db_open: Recovery skipped in read-only mode. Run manual recovery if errors are encountered. Après quelques recherches sur &#171;&#160;db_recover&#160;&#187; et après avoir essayé de lire les [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Lundi matin, une journée qui commence bien. Le service &laquo;&nbsp;slapd&nbsp;&raquo; étant arrêté, je me jette dans les logs et voilà ce que j&#8217;y trouve:</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">bdb_db_open: unclean shutdown detected; attempting recovery.<br />
bdb_db_open: Recovery skipped in read-only mode. Run manual recovery if errors are encountered.</div></td></tr></tbody></table></div>
<p><span id="more-290"></span><br />
Après quelques recherches sur &laquo;&nbsp;db_recover&nbsp;&raquo; et après avoir essayé de lire les pages man introuvables&#8230; je me lance à la sauvage:</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">/etc/init.d/ldap stop</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">db_recover -v -h /var/lib/ldap</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">/etc/init.d/ldap start</div></td></tr></tbody></table></div>
<p>Le service repart, puis s&#8217;écroule quelques minutes plus tard en m&#8217;insultant de la même façon. Seule option restante: Récupérer les .bdb stocké sur la bande de sauvegarde de la veille:</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">/etc/init.d/ldap stop</div></td></tr></tbody></table></div>
<p>A la recherche de mes fichiers:</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">tar tvf /dev/st0 | grep *.bdb</div></td></tr></tbody></table></div>
<p>Ouf, tout est là: On restaure.</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">tar xvf /dev/st0 var/lib/ldap</div></td></tr></tbody></table></div>
<p>Si, comme moi, vos fichiers font plus de 2Go, allez donc boire une cafetière de café.. ou prendre un Xanax..</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">slapd -d 256</div></td></tr></tbody></table></div>
<p>Je vous passe le tas de logs qu&#8217;il m&#8217;a vomi à ce moment précis -c&#8217;est plutôt bon signe- il est enfin lancé&#8230; et à l&#8217;air de s&#8217;y plaire. <strong>Attention à ne pas le stopper à l&#8217;aide d&#8217;un CTRL+C, ce qui pourrais causer une nouvelle corruption !</strong> Pour cela on va lui demander plus poliment:</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">kill -INT ‛cat /var/run/ldap/slapd.pid‛</div></td></tr></tbody></table></div>
<p>Puis on relance, proprement:</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">/etc/init.d/ldap start</div></td></tr></tbody></table></div>
<p>Note: <em>n&#8217;oubliez pas de vérifier que les fichiers contenus dans le répertoire /var/lib/ldap appartiennent bien à ldap:ldap après la restauration, c&#8217;est du vécu..</em></p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/ldap-bdb_db_open-unclean-shutdown-detected-290/feed/</wfw:commentRss>
<slash:comments>30</slash:comments>
</item>
<item>
<title>Redirection de courrier sous Postfix</title>
<link>http://www.crashdump.fr/debian/redirection-de-courrier-sous-postfix-271/</link>
<comments>http://www.crashdump.fr/debian/redirection-de-courrier-sous-postfix-271/#comments</comments>
<pubDate>Wed, 13 Aug 2008 10:00:08 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Réseaux]]>
</category>
<category>
<![CDATA[aliases]]>
</category>
<category>
<![CDATA[copie]]>
</category>
<category>
<![CDATA[courrier]]>
</category>
<category>
<![CDATA[email]]>
</category>
<category>
<![CDATA[mail]]>
</category>
<category>
<![CDATA[Manitoba]]>
</category>
<category>
<![CDATA[newaliases]]>
</category>
<category>
<![CDATA[postfix]]>
</category>
<category>
<![CDATA[redirection]]>
</category>
<category>
<![CDATA[transfert]]>
</category>
<guid isPermaLink="false">http://www.crashdump.fr/?p=271</guid>
<description>
<![CDATA[Aujourd&#8217;hui je me suis confronté a une demande, dans mon travail, que je ne savais pas du tout comment résoudre, alors je vous fait partager mon expérience: Problème: &#171;&#160;Envoyer une copie du courrier reçu sur un compte mail vers une autre adresse.&#160;&#187; Sachant que le serveur mail est Postfix. Réponse: &#171;&#160;Simple, les aliases !&#160;&#187; En [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Aujourd&#8217;hui je me suis confronté a une demande, dans mon travail, que je ne savais pas du tout comment résoudre, alors je vous fait partager mon expérience:</p>
<li>Problème: &laquo;&nbsp;Envoyer une copie du courrier reçu sur un compte mail vers une autre adresse.&nbsp;&raquo;</li>
<p><em>Sachant que le serveur mail est Postfix.</em></p>
<li>Réponse: &laquo;&nbsp;Simple, les aliases !&nbsp;&raquo;</li>
<p>En quelques lignes cela pourrais se répondre: man aliases, RTFM, mais je ne suis pas un salop, alors je vais vous décrire la solution que j&#8217;ai trouvé.. ;)<br />
<span id="more-271"></span><br />
Le fichier aliases de Postfix permet, comme son nom l&#8217;indique, de créer des alias et donc de ridiriger tout les mails pour les comptes locaux. Ce fichier est un bête fichier texte qui, une fois modifié servira a postalias pour créer un .db. Il faudra donc le modifier en respectant une syntaxe particulière, le sauvegarder, puis l&#8217;exporter avec la commande &laquo;&nbsp;newaliases&nbsp;&raquo;. Mais rentrons directement dans le vif du sujet:</p>
<li>
<h3>Editer le /etc/postifx/aliases</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">vim /etc/postfix/aliases</div></td></tr></tbody></table></div>
<p>Le fichier accepte un format bien précis, de la forme suivante:</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">nom: destinataire1, destinataire2, ...</div></td></tr></tbody></table></div>
<p>Exemple: Mettons une adresse grouik@crashdump.fr dont j&#8217;aimerais envoyer une copie de tout les messages à patate@crashdump.fr et à dindon@crashdump.fr (ça fait moins serieux, du coup!) mon fichier aliases ressemblera donc à ça:</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">grouik: grouik, patate, dindon</div></td></tr></tbody></table></div>
<p><em>Notez que j&#8217;ai répété grouik dans les destinataires, sinon il ne recevra plus les message qui lui sont destiné.</em></p>
<li>
<h3>Créer le aliases.db et informer Postfix du changement</h3>
</li>
<p>Un petit programme se charge de 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">newaliases</div></td></tr></tbody></table></div>
<p><em>astuce: si vous avez beaucoup de destinataires, vous pouvez les écrire sur plusieurs lignes en commençant les lignes suivantes par un espace.</em></p>
<p><em>Merci de votre lecture, et n&#8217;hésitez pas a poser vos questions dans les commentaires. J&#8217;y répondrais le plus vite possible.</p>
<p></em></p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/redirection-de-courrier-sous-postfix-271/feed/</wfw:commentRss>
<slash:comments>2</slash:comments>
</item>
<item>
<title>Freeze SSH, une solution.</title>
<link>http://www.crashdump.fr/debian/freeze-ssh-une-solution-226/</link>
<comments>http://www.crashdump.fr/debian/freeze-ssh-une-solution-226/#comments</comments>
<pubDate>Mon, 11 Aug 2008 16:15:33 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Apple]]>
</category>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[freeze]]>
</category>
<category>
<![CDATA[solution]]>
</category>
<category>
<![CDATA[ssh]]>
</category>
<category>
<![CDATA[ssh_config]]>
</category>
<guid isPermaLink="false">http://www.crashdump.fr/?p=226</guid>
<description>
<![CDATA[Etant actuellement connecté via une connexion wifi plutôt instable avec mon mac (est-ce lié?), j&#8217;avais souvent des freezes de ssh.. et il n&#8217;y a rien de pire que devoir tout reprendre a zéro. Et en feuilletant le manpage de sshd_config j&#8217;ai trouvé deux paramètres bien sympathiques qui ont résolu mon problème. /etc/ssh/sshd_config ou /home/$USERNAME/.ssh.config 12ClientAliveInterval [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Etant actuellement connecté via une connexion wifi plutôt instable <em>avec mon mac (est-ce lié?)</em>, j&#8217;avais souvent des freezes de ssh.. et il n&#8217;y a rien de pire que devoir tout reprendre a zéro. Et en feuilletant le manpage de sshd_config j&#8217;ai trouvé deux paramètres bien sympathiques qui ont résolu mon problème.</p>
<p><em>/etc/ssh/sshd_config ou /home/$USERNAME/.ssh.config</em></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">ClientAliveInterval 30<br />
ClientAliveCountMax 5</div></td></tr></tbody></table></div>
<blockquote><p>ServerAliveInterval<br />
Sets a timeout interval in seconds after which if no data has been received from the server, ssh(1) will send a message through the encrypted channel to request a response from the server. The default is 0, indicating that these messages will not be sent to the server. This option applies to protocol version 2 only.</p>
<p>ServerAliveCountMax<br />
Sets the number of server alive messages (see below) which may be sent without ssh(1) receiving any messages back from the server. If this threshold is reached while server alive messages are being sent, ssh will disconnect from the server, terminating the session. It is important to note that the use of server alive messages is very different from TCPKeepAlive (below). The server alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The server alive mechanism is valuable when the client or server depend on knowing when a connection has become inactive.<br />
The default value is 3. If, for example, ServerAliveInterval (see below) is set to 15 and ServerAliveCountMax is left at the default, if the server becomes unresponsive, ssh will disconnect after approximately 45 seconds. This option applies to protocol version 2 only.</p></blockquote>
<p>Si cela ne fonctionne toujours pas, <a rel="nofollow" href="http://www.harding.motd.ca/autossh/">il vous reste AutoSSH</a>&#8230;</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/freeze-ssh-une-solution-226/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Faille SSL Debian (RGN)</title>
<link>http://www.crashdump.fr/debian/faille-ssl-debian-rgn-147/</link>
<comments>http://www.crashdump.fr/debian/faille-ssl-debian-rgn-147/#comments</comments>
<pubDate>Mon, 26 May 2008 18:51:35 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Réseaux]]>
</category>
<category>
<![CDATA[Sécurité]]>
</category>
<category>
<![CDATA[bug]]>
</category>
<category>
<![CDATA[DSA]]>
</category>
<category>
<![CDATA[faille]]>
</category>
<category>
<![CDATA[Luciano Bello]]>
</category>
<category>
<![CDATA[Manitoba]]>
</category>
<category>
<![CDATA[OpenSSL]]>
</category>
<category>
<![CDATA[prng]]>
</category>
<category>
<![CDATA[random]]>
</category>
<category>
<![CDATA[RSA]]>
</category>
<category>
<![CDATA[ssh]]>
</category>
<category>
<![CDATA[vulnerabilité]]>
</category>
<guid isPermaLink="false">http://blog.crashdump.fr/?p=147</guid>
<description>
<![CDATA[Le 13 Mai 2008, Le projet Debian annonçais ce que Luciano Bello avais trouvé: Une vulnérabilité dans le package &#171;&#160;OpenSSL&#160;&#187;. Le bug en question est causé par la suppression pure et simple du code suivant dans md_rand.c: 123MD_Update(&#38;m,buf,j); [ .. ] MD_Update(&#38;m,buf,j); /* purify complains */ Ces lignes ont été retirée parce qu&#8217;elle produisait des [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Le 13 Mai 2008, Le projet Debian annonçais ce que Luciano Bello avais trouvé: Une vulnérabilité dans le package &laquo;&nbsp;OpenSSL&nbsp;&raquo;. Le bug en question est causé par la suppression pure et simple du code suivant dans md_rand.c:</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">MD_Update(&amp;m,buf,j);<br />
[ .. ]<br />
MD_Update(&amp;m,buf,j); /* purify complains */</div></td></tr></tbody></table></div>
<p>Ces lignes ont été retirée parce qu&#8217;elle produisait des erreurs avec certains outils (Utilisation d&#8217;une donnée non initialisée dans la plupart des projets liés a OpenSSL). Mais la suppression de des lignes en question à eu des effets collatéraux sur OpenSSL PRNG. En fait au lieux de mélanger différentes variables aléatoire pour la génération initiale, la seule variable &laquo;&nbsp;aléatoire&nbsp;&raquo; qui a été utilisée étais le PID du générateur -et quand on sais que le nombre maximal par défaut sous linux est de 32,768- le résultat est que PRNG utilise une très petite fourchette de valeurs initiales.<br />
<span id="more-147"></span></p>
<h2>
<li>Impact:</li>
</h2>
<p>Toutes les clés SSL et SSH générées sur des systèmes basé sur Debian (Ubuntu, Debina, Mint&#8230;) entre Septembre 2006 et le 13 Mai 2008 sont affectée par la vulnérabilité. Dans le cas des clé SSL, tout les certificats doivent être révoqué et a nouveau généré. Tous les administrateurs système doivent auditer leurs clés pour être sur qu&#8217;ils ne sont pas touché par la vulnérabilité ! D&#8217;ailleurs tout les outils liés de près ou de loin a OpenSSL PRNG peut être vulnérable, attention.</p>
<p>Tout flux d&#8217;un serveur SSH qui utilise une clé générée par un système vulnérable peut être sujet a une interception (man in the middle) sans que l&#8217;administrateur ne se rende compte de rien. Je vous rassure, les projets Debian et Ubuntu on développé des outils pour identifier les clé vulnérables, vous trouverez plus d&#8217;information a leurs propos en fin de page.</p>
<p>Q: Combien de temps cela prendrais de générer toutes les clés touchées ?<br />
A: Avec 31 Xeon @ 2.33Ghz. Cela prend deux heures pour les clés DSA 1024-bit et RSA 2048-bit pour x86. Les clés RSA 4096-bit sont générés en 6 heures. En ce qui concerne les clés RSA 8192-bit cela prendrais environs 100 heures.</p>
<p>Q: Combien de temps cela prendrait il de cracker un SSH avec ces clés ?<br />
A: Tout dépend de la vitesse du réseau et de la configuration du serveur SSH. Il devrait être possible d&#8217;essayer toutes les clés (32,767 DSA 1024 et RSA 2048) en quelques heures. Attentions aux scripts tels que Fail2Ban (anti-bruteforce).. etc.</p>
<p>Q: J&#8217;utilise une clé RSA 16384 bit, suis-je vulnérable ?<br />
A: Oui, c&#8217;est juste une question de temps (processeur et réseau). Pour le RSA 8192 bit, cela prend environ 3100 heures pour générer toutes les clés. J&#8217;imagine que pour le 16384 bit, nous serions dans les 100,000 heures (en temps CPU). Mais gardez en tête que la &laquo;&nbsp;fourchette&nbsp;&raquo; réele est bien plus mince, basée sur PID du processus qui a servit a générer le tout. Donc, inutile de générer toutes les clé pour en couvrir la majorité ! (La plupart de ces clés sont dans les premiers 3,000 PID)..</p>
<p><a rel="nofollow" href="http://www.debian.org/security/key-rollover/">http://www.debian.org/security/key-rollover/</a><br />
<a rel="nofollow" href="http://wiki.debian.org/SSLkeys">http://wiki.debian.org/SSLkeys</a></p>
<p><a href='http://www.crashdump.fr/wp-content/uploads/2008/05/random_number.png'><img src="http://www.crashdump.fr/wp-content/uploads/2008/05/random_number-250x144.png" alt="" title="random_number" width="250" height="144" class="alignnone size-thumbnail wp-image-148" /></a></p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/faille-ssl-debian-rgn-147/feed/</wfw:commentRss>
<slash:comments>1</slash:comments>
</item>
<item>
<title>Bug dpkg ? La solution !</title>
<link>http://www.crashdump.fr/debian/bug-dpkg-la-solution-68/</link>
<comments>http://www.crashdump.fr/debian/bug-dpkg-la-solution-68/#comments</comments>
<pubDate>Wed, 12 Mar 2008 22:27:59 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[avaible]]>
</category>
<category>
<![CDATA[bug]]>
</category>
<category>
<![CDATA[clean]]>
</category>
<category>
<![CDATA[dpkg]]>
</category>
<category>
<![CDATA[erreur]]>
</category>
<guid isPermaLink="false">http://blog.crashdump.fr/index.php/2008/03/12/bug-dpkg-la-solution/</guid>
<description>
<![CDATA[Vous avez l&#8217;erreur suivante ? 123# dpkg -i xxx.deb dpkg: erreur d'analyse syntaxique, dans le fichier « /var/lib/dpkg/available » près de la ligne 9601 paquet « xxx »: &#160;saut de ligne dans le nom de champ « S » Parfois, il arrive que les fichiers de cache soit corrompus.. soit ! Il suffit de les [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Vous avez l&#8217;erreur suivante ?</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"># dpkg -i xxx.deb<br />
dpkg: erreur d'analyse syntaxique, dans le fichier « /var/lib/dpkg/available » près de la ligne 9601 paquet « xxx »:<br />
&nbsp;saut de ligne dans le nom de champ « S »</div></td></tr></tbody></table></div>
<p>Parfois, il arrive que les fichiers de cache soit corrompus.. soit ! Il suffit de  les purger !</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"># dpkg --clear-avail<br />
# aptitude update</div></td></tr></tbody></table></div>
<p>et c&#8217;est reparti !</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/bug-dpkg-la-solution-68/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Supprimer un &#171;&#160;host reject&#160;&#187; sur route ?</title>
<link>http://www.crashdump.fr/debian/supprimer-un-host-reject-sur-route-84/</link>
<comments>http://www.crashdump.fr/debian/supprimer-un-host-reject-sur-route-84/#comments</comments>
<pubDate>Wed, 27 Feb 2008 17:13:38 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Réseaux]]>
</category>
<category>
<![CDATA[Sécurité]]>
</category>
<category>
<![CDATA[host reject]]>
</category>
<category>
<![CDATA[Manitoba]]>
</category>
<category>
<![CDATA[routage]]>
</category>
<category>
<![CDATA[route]]>
</category>
<category>
<![CDATA[supprimer]]>
</category>
<guid isPermaLink="false">http://blog.crashdump.fr/index.php/2008/02/27/supprimer-un-host-reject-sur-route/</guid>
<description>
<![CDATA[Si, comme moi vous avez ajouté un host deny sur route (!H) : 1#/sbin/route add -host aa.bb.cc.dd reject Et que vous êtes dans l&#8217;impossibilité de la supprimer, voila la solution: 1route del -host aa.bb.cc.dd reject ..et dire que c&#8217;est même pas écris dans les man pages.. Voila qui m&#8217;a donné envie d&#8217;écrire un tutoriel sur [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Si, comme moi vous avez ajouté un host deny sur route (!H) :</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">#/sbin/route add -host aa.bb.cc.dd reject</div></td></tr></tbody></table></div>
<p>Et que vous êtes dans l&#8217;impossibilité de la supprimer, voila la solution:</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">route del -host aa.bb.cc.dd reject</div></td></tr></tbody></table></div>
<p>..et dire que c&#8217;est même pas écris dans les man pages.. Voila qui m&#8217;a donné envie d&#8217;écrire un tutoriel sur route ! a bientôt ;)</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/supprimer-un-host-reject-sur-route-84/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Mettre a jour une Debian Dedibox: Exploit root vmsplice</title>
<link>http://www.crashdump.fr/debian/mettre-a-jour-le-kernel-dun-debian-dedibox-exploit-root-vmsplice-69/</link>
<comments>http://www.crashdump.fr/debian/mettre-a-jour-le-kernel-dun-debian-dedibox-exploit-root-vmsplice-69/#comments</comments>
<pubDate>Thu, 14 Feb 2008 08:02:56 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Sécurité]]>
</category>
<category>
<![CDATA[dedibox]]>
</category>
<category>
<![CDATA[faille]]>
</category>
<category>
<![CDATA[ftp://ftp.dedibox.fr/pub/dedibox/fix/fix-grub-root.sh]]>
</category>
<category>
<![CDATA[ftp://ftp.dedibox.fr/pub/dedibox/kernel/r8-1/C7-X86-32bits/kernel-image-2.6.24.2-c7-r8-1.deb]]>
</category>
<category>
<![CDATA[kernel]]>
</category>
<category>
<![CDATA[mise a jour]]>
</category>
<category>
<![CDATA[noyau]]>
</category>
<category>
<![CDATA[patch grub]]>
</category>
<category>
<![CDATA[update]]>
</category>
<category>
<![CDATA[upgrade]]>
</category>
<category>
<![CDATA[vmsplice]]>
</category>
<guid isPermaLink="false">http://www.crashdump.fr/blog/index.php/2008/02/14/mettre-a-jour-le-kernel-dun-debian-dedibox-exploit-root-vmsplice/</guid>
<description>
<![CDATA[http://www.securiteam.com/unixfocus/5JP0C0UNFU.html Un tutoriel de mise a jour du kernel par dedibox: http://documentation.dedibox.fr/doku.php?id=distrib:kernel&#038;s=noyau La faille a été corrigé par les équipes de sécurité de la plupart des distributions. Aussi peut être pensez vous comme moi qu’un simple (pour debian) 12# apt-get update # apt-get upgrade Pourrais vous mettre à l&#8217;abri… Malheureusement chez dédibox il est optimisé [...]]]>
</description>
<content:encoded>
<![CDATA[<p><a rel="nofollow" href="http://www.securiteam.com/unixfocus/5JP0C0UNFU.html">http://www.securiteam.com/unixfocus/5JP0C0UNFU.html</a></p>
<p>Un tutoriel de mise a jour du kernel par dedibox: <a rel="nofollow" href="http://documentation.dedibox.fr/doku.php?id=distrib:kernel&#038;s=noyau">http://documentation.dedibox.fr/doku.php?id=distrib:kernel&#038;s=noyau</a></p>
<p>La faille a été corrigé par les équipes de sécurité de la plupart des distributions.<br />
Aussi peut être pensez vous comme moi qu’un simple (pour debian)</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"># apt-get update<br />
# apt-get upgrade</div></td></tr></tbody></table></div>
<p>Pourrais vous mettre à l&#8217;abri… Malheureusement chez dédibox il est optimisé pour C7, donc spécifique. Pas de panique ça reste assez simple a corriger quand même.</p>
<ul>La manipulation pour corriger la faille est décrite ici:</ul>
<p>Je l’ai testé sur une testing:<br />
<span id="more-69"></span><br />
Si vous avez installé votre dédibox avant le 28 Mai 2006 (ou si vous possedez une version raid), cette partie ne vous concerne pas !<br />
Sinon, distributions Ubuntu-Server, Ubuntu Dedibox et Debian Sarge comportent un bug dans le comportement de grub-install. On va donc patcher grub.</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"># wget --passive ftp://ftp.dedibox.fr/pub/dedibox/fix/fix-grub-root.sh &amp;&amp; chmod +x fix-grub-root.sh</div></td></tr></tbody></table></div>
<p>On cherche sur quelle partition est “/” (pour savoir sur quel disque on boot):</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">mount | grep &quot;/ &quot;</div></td></tr></tbody></table></div>
<p>Ce qui devrait vous retourner quelque chose du genre:</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">/dev/sda1 on / type ext3 (rw,errors=remount-ro)</div></td></tr></tbody></table></div>
<p>C’est ce sda1 qui nous intéresse.. c&#8217;est le disque sur lequel boot votre machine !</p>
<p>On va donc lancer le script téléchargé précédemment, avec comme paramètre sda1 (dans notre cas, sinon remplacez par la bonne valeur):</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"># ./fix-grub-root.sh sda1</div></td></tr></tbody></table></div>
<p>Le script va modifier le fichier: /boot/grub/menu.lst pour y entrer les bonnes valeurs. Si un problème survient par la suite, le script créé une sauvegarde de ce fichier ici: /boot/grub/menu.lst.bak</p>
<ul>Mise a jour du Kernel</ul>
<p>On le télécharge:</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"># wget --passive ftp://ftp.dedibox.fr/pub/dedibox/kernel/r8-1/C7-X86-32bits/kernel-image-2.6.24.2-c7-r8-1.deb</div></td></tr></tbody></table></div>
<p>Puis on l’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"># dpkg -i kernel-image-2.6.24.2-c7-r8-1.deb</div></td></tr></tbody></table></div>
<p>On met a jour grub:</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"># update-grub<br />
Searching for GRUB installation directory ... found: /boot/grub<br />
Searching for default file ... found: /boot/grub/default<br />
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst<br />
Searching for splash image ... none found, skipping ...<br />
&lt;strong&gt;Found kernel: /vmlinuz-2.6.24.2&lt;/strong&gt;<br />
Found kernel: /vmlinuz-2.6.23.13dedibox-r8<br />
Updating /boot/grub/menu.lst ... done</div></td></tr></tbody></table></div>
<p>Tout va bien il a trouvé notre noyau.. donc on reboot:</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"># reboot</div></td></tr></tbody></table></div>
<p>Prennez un café&#8230; puis on vérifie:</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"># uname -r<br />
2.6.24.2dedibox-r8</div></td></tr></tbody></table></div>
<ul>Ipv6 Activé ?</ul>
<p>Il faut impérativement penser que l&#8217;IPV6 est activé et qu&#8217;il faut mettre les règles adoc pour filtrer un minimum.<br />
Personnellement, j e n&#8217;utilise pas &laquo;&nbsp;encore&nbsp;&raquo; ipv6 donc j&#8217;ai entré ces règles dans mon script iptables/ip6tables :</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 /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ip6tables -P INPUT DROP<br />
ip6tables -P OUTPUT DROP<br />
ip6tables -P FORWARD DROP<br />
echo &quot; Flushing rules (ip6)&quot;<br />
ip6tables --flush<br />
ip6tables --flush INPUT<br />
ip6tables --flush OUTPUT<br />
ip6tables --flush FORWARD<br />
ip6tables --flush -t mangle<br />
ip6tables --flush -t nat<br />
ip6tables --delete-chain</div></td></tr></tbody></table></div>
<p>C&#8217;est bon, je peut donc aller me recoucher, en paix. ;)</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/mettre-a-jour-le-kernel-dun-debian-dedibox-exploit-root-vmsplice-69/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Installer Spamassasin pour exim4 sous debian</title>
<link>http://www.crashdump.fr/debian/installer-spamassasin-pour-exim4-sous-debian-58/</link>
<comments>http://www.crashdump.fr/debian/installer-spamassasin-pour-exim4-sous-debian-58/#comments</comments>
<pubDate>Sat, 09 Feb 2008 14:13:22 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Change]]>
</category>
<category>
<![CDATA[exim4]]>
</category>
<category>
<![CDATA[mise a jour]]>
</category>
<category>
<![CDATA[spamassasin]]>
</category>
<category>
<![CDATA[spamd]]>
</category>
<guid isPermaLink="false">http://www.crashdump.fr/blog/?p=58</guid>
<description>
<![CDATA[Installer spamassasin On commence par telecharger et installer l&#8217;appli: 1# aptitude install spamassassin Configurer Exim4 Ouvrir le fichier de configuration exim4 concernant la configuration des options (attention, suivant le type d&#8217;installation d&#8217;exim le fichier de configuration peut ne pas se trouver au même endroit, en effet il existe une installation avec un fichier de configuration [...]]]>
</description>
<content:encoded>
<![CDATA[<h2>
<li>Installer spamassasin</li>
</h2>
<p>On commence par telecharger et installer l&#8217;appli:</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 spamassassin</div></td></tr></tbody></table></div>
<h2>
<li>Configurer Exim4</li>
</h2>
<p>Ouvrir le fichier de configuration exim4 concernant la configuration des options (attention, suivant le type d&#8217;installation d&#8217;exim le fichier de configuration peut ne pas se trouver au même endroit, en effet il existe une installation avec un fichier de configuration unique et un type d&#8217;installation avec un fichier .conf unique) donc:</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"># vim /etc/exim4/conf.d/main/02_exim4-config_options</div></td></tr></tbody></table></div>
<p>Et décommenter la ligne suivante:</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">spamd_address = 127.0.0.1 783</div></td></tr></tbody></table></div>
<p><span id="more-58"></span></p>
<h2>
<li>Configurer spamd</li>
</h2>
<p>Editer le fichier config:<br />
<strong># vim /etc/default/spamassassin</strong></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">// Change to one to enable spamd<br />
ENABLED=1</div></td></tr></tbody></table></div>
<h2>
<li>Demmarer SpamAssassin</li>
</h2>
<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"># /etc/init.d/spamassassin start</div></td></tr></tbody></table></div>
<h2>
<li>Mise a jour automatique</li>
</h2>
<p>Et pour finir, on va mettre en place une mise à jour (via cron) de spamd&#8230; Pour cela:</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 /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># cat &gt; /root/ majspamassasin.sh <br />
#!/bin/sh<br />
# Update SpamAssassin Rules<br />
/usr/bin/sa-update -D channel,dns<br />
/etc/init.d/spamassassin restart</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"># crontab -e</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">55 &nbsp; 5 &nbsp;* &nbsp; * &nbsp; * &nbsp;/root/majspamassasin.sh 2&amp;1&gt;/dev/null</div></td></tr></tbody></table></div>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/installer-spamassasin-pour-exim4-sous-debian-58/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Apt- l&#8217;un des meilleurs système de gestion de package.</title>
<link>http://www.crashdump.fr/debian/apt-lun-des-meilleurs-systeme-de-gestion-de-package-37/</link>
<comments>http://www.crashdump.fr/debian/apt-lun-des-meilleurs-systeme-de-gestion-de-package-37/#comments</comments>
<pubDate>Thu, 08 Nov 2007 22:10:37 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[apt]]>
</category>
<category>
<![CDATA[aptitude]]>
</category>
<category>
<![CDATA[installer]]>
</category>
<category>
<![CDATA[search]]>
</category>
<guid isPermaLink="false">http://blog.nexus-6.fr/?p=37</guid>
<description>
<![CDATA[Suite au diverses question que l&#8217;on me pose, j&#8217;ai décidé de poster un mémento sur Apt (Advanced Packaging Tool) le gestionnaire de paquets utilisé par Debian et ses dérivés. PT fut conçu à l&#8217;origine pour fonctionner avec des paquets .deb sur des systèmes Debian, mais a depuis été adapté pour fonctionner avec des paquets Red [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Suite au diverses question que l&#8217;on me pose, j&#8217;ai décidé de poster un mémento sur Apt (Advanced Packaging Tool) le gestionnaire de paquets utilisé par Debian et ses dérivés.</p>
<p>PT fut conçu à l&#8217;origine pour fonctionner avec des paquets .deb sur des systèmes Debian, mais a depuis été adapté pour fonctionner avec des paquets Red Hat Package Manager avec l&#8217;outil apt-rpm, et pour fonctionner sur d&#8217;autres systèmes d&#8217;exploitation tels que Mac OS X (voir Fink). Sur les systèmes avec une gestion de paquets basée sur le format .deb, comme Debian, APT est une interface à dpkg.</p>
<p>APT simplifie l&#8217;installation, la mise à jour et la désinstallation de logiciels en automatisant la récupération de paquets à partir de sources APT (sur Internet, le réseau local, des CDs, etc.), la gestion des dépendances et parfois la compilation. Lorsque des paquets sont installés, mis à jour ou enlevés, les programmes de gestion de paquets peuvent afficher les dépendances des paquets, demander à l&#8217;administrateur si des paquets recommandés ou suggérés par des paquets nouvellement installés devraient aussi être installés, et résoudre les dépendances automatiquement. Les programmes de gestion de paquets peuvent aussi mettre à jour tous les paquets.<br />
<span id="more-37"></span><br />
Il n&#8217;existe pas de commande apt en tant que tel. APT est essentiellement une bibliothèque C++ de fonctions utilisées par plusieurs programmes de gestion de paquets. Un de ces programmes est apt-get, probablement le plus connu.</p>
<h2>
<li>Installer</li>
</h2>
<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 [package]</div></td></tr></tbody></table></div>
<p>, Installe [package]</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 -s install [package]</div></td></tr></tbody></table></div>
<p>, Simule l’installation de [package]</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 reinstall install [package]</div></td></tr></tbody></table></div>
<p>, Réinstalle [package]</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 [package]/[distrib]</div></td></tr></tbody></table></div>
<p>, Installe la version de [package] de la distribution [package]</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 [package]=[version]</div></td></tr></tbody></table></div>
<p>, Installe [package] dans la version [version]</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 source [package]</div></td></tr></tbody></table></div>
<p>, Télécharge le package source</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 -b source [package]</div></td></tr></tbody></table></div>
<p>, Télécharge le package source et le compile ensuite</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 build-dep [package]</div></td></tr></tbody></table></div>
<p>, Télécharge les dépendances du package source
<package> qui va etre compilé</p>
<h2>
<li>Désinstaller</li>
</h2>
<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 remove [package]</div></td></tr></tbody></table></div>
<p>, Désinstalle [package] et tous ceux qui en dépendent</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 purge remove [package]</div></td></tr></tbody></table></div>
<p>, Désinstalle aussi les fichiers de conguration</p>
<h2>
<li>Mettre jour</li>
</h2>
<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-show-versions -u</div></td></tr></tbody></table></div>
<p>, Affiche la liste des packages pouvant etre mis jour</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 update</div></td></tr></tbody></table></div>
<p>, Mise jour de la liste des packages disponibles</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 -u upgrade</div></td></tr></tbody></table></div>
<p>, Liste et met jour les packages pouvant Etre mis jour</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 dist-upgrade</div></td></tr></tbody></table></div>
<p>, Met jour tout le système</p>
<h2>
<li>Nettoyer</li>
</h2>
<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 clean</div></td></tr></tbody></table></div>
<p>, Vide le /var/cache/apt/archives</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 autoclean</div></td></tr></tbody></table></div>
<p>, Enleve uniquement les packages obsolétes</p>
<h2>
<li>S’informer
<li></h2>
<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-cache search [foobar]</div></td></tr></tbody></table></div>
<p>, Cherche dans la liste des packages disponibles les occurences de [foobar]</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-cache show [package]</div></td></tr></tbody></table></div>
<p>, Description de [package]</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-cache depends [package]</div></td></tr></tbody></table></div>
<p>, Dépendances de [package]</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-le search [fichier]</div></td></tr></tbody></table></div>
<p>, Affiche le nom du package qui fournnit [fichier]</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-le list [package]</div></td></tr></tbody></table></div>
<p>, contenu de [package]</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-le update</div></td></tr></tbody></table></div>
<p>, Mise jour de la base de données de apt-le</p>
<h2>
<li>Configurer</li>
</h2>
<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-cong [package]</div></td></tr></tbody></table></div>
<p>, Reconfigure [package]</p>
<h2>
<li>Cloner</li>
</h2>
<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">dpkg get-selections &gt; selected</div></td></tr></tbody></table></div>
<p>, Liste des packages installés danns le chier selected</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">dpkg set-selections &lt; selected</div></td></tr></tbody></table></div>
<p>, Sélection des packages répertoriés dans le chier selected</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 dselect-upgrade</div></td></tr></tbody></table></div>
<p>, Installation des packages sélectionné par dselect ou directement par dpkg</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/apt-lun-des-meilleurs-systeme-de-gestion-de-package-37/feed/</wfw:commentRss>
<slash:comments>1</slash:comments>
</item>
<item>
<title>:(){ :&#124;:&amp; };: ? Vous avez dit Forkbomb ?</title>
<link>http://www.crashdump.fr/debian/vous-avez-dit-forkbomb-79/</link>
<comments>http://www.crashdump.fr/debian/vous-avez-dit-forkbomb-79/#comments</comments>
<pubDate>Fri, 24 Aug 2007 21:01:25 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[Sécurité]]>
</category>
<category>
<![CDATA[Bash]]>
</category>
<category>
<![CDATA[bomb]]>
</category>
<category>
<![CDATA[c]]>
</category>
<category>
<![CDATA[fork]]>
</category>
<category>
<![CDATA[fork bomb]]>
</category>
<category>
<![CDATA[perl]]>
</category>
<category>
<![CDATA[processus]]>
</category>
<guid isPermaLink="false">http://blog.crashdump.fr/index.php/2008/02/24/vous-avez-dit-forkbomb/</guid>
<description>
<![CDATA[Qu&#8217;est ce qu&#8217;une fork bomb ? La fork bomb est un programme se dupliquant a l&#8217;infini. Si l&#8217;on prend en compte que le nombre de processus pouvant être exécutés simultanément sur un ordinateur est limité, vous comprendrez vite ou cela nous mène ! Comment elle fonctionne exactement ? Comme je vous l&#8217;ai dit plus haut, [...]]]>
</description>
<content:encoded>
<![CDATA[<h2>
<li>Qu&#8217;est ce qu&#8217;une fork bomb ?</li>
</h2>
<p>La fork bomb est un programme se dupliquant a l&#8217;infini. Si l&#8217;on prend en compte que le nombre de processus pouvant être exécutés simultanément sur un ordinateur est limité, vous comprendrez vite ou cela nous mène ! </p>
<h2>
<li>Comment elle fonctionne exactement ?</li>
</h2>
<p>Comme je vous l&#8217;ai dit plus haut, Elle créé un grand nombre de processus très rapidement afin de saturer le nombre de processus maximum du système. Si la table des processus est saturée, aucun nouveau programme ne peut démarrer tant qu&#8217;aucun autre ne termine. Et encore, même si cela arrive, il est peu probable qu&#8217;un programme utile démarre étant donné que les instances de la bombe attendent chacune d&#8217;occuper cet emplacement libre. Bref, la misère.</p>
<h2>
<li>Résultats ?</li>
</h2>
<p>Non seulement les fork bombs utilisent de la place dans la table des processus, mais elles utilisent chacune du temps processeur et de la mémoire. En conséquence, le système et les programmes tournant à ce moment-là ralentissent et deviennent même impossibles à utiliser. Pour peut que les processus lancés soit un peut gourmand en mémoire, le système peut rapidement swapper et occuper toute la mémoire virtuelle (SWAP). Les fork bomb peuvent donc être considérées comme des virus non destructifs&#8230; Bien que énervants.<br />
<span id="more-79"></span></p>
<h2>
<li>Exemples:</li>
</h2>
<p><strong>En Perl:</strong></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 -e &quot;fork while fork&quot; &amp;</div></td></tr></tbody></table></div>
<p><strong>en Bash :</strong></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">$ :(){ :|:&amp; };:</div></td></tr></tbody></table></div>
<p><strong>Via .Bat, ms-dos:</strong></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">:s<br />
start notepad.exe<br />
goto s</div></td></tr></tbody></table></div>
<p><strong>En C:</strong></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">#include &lt;unistd.h&gt;<br />
int main(void) {<br />
&nbsp; while(1) { <br />
&nbsp; &nbsp; fork(); <br />
&nbsp; } <br />
&nbsp; return 0; <br />
}</div></td></tr></tbody></table></div>
<p><strong>En HTML:</strong></p>
<p><em>forkbomb.htm:</em></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 /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt; html&gt;<br />
&lt; frameset&gt;<br />
&nbsp; &lt; frame src=&quot;forkbomb.htm&quot; name=&quot;ForkB1&quot;&gt;<br />
&nbsp; &lt; frame src=&quot;forkbomb.htm&quot; name=&quot;ForkB2&quot;&gt;<br />
&lt; /frameset&gt;<br />
&lt; /html&gt;</div></td></tr></tbody></table></div>
<h2>
<li>Difficulté</li>
</h2>
<p>Une fois la fork bomb lancée avec succès dans un système, il peut devenir impossible de retrouver un fonctionnement normal sans redémarrer, étant donné que la seule solution à une fork bomb est de détruire toutes ses instances. Essayer d&#8217;utiliser un programme pour tuer les processus requiert la création d&#8217;un processus, ce qui peut être impossible s&#8217;il n&#8217;y a pas d&#8217;emplacement vide dans la table des processus, ou d&#8217;espace dans les structures mémoires.</p>
<h2>
<li>Prévention</li>
</h2>
<p>La fork bomb fonctionne en créant autant de processus que possible. Ainsi, pour empêcher une fork bomb, il suffit simplement de limiter le nombre de processus pouvant être exécutés par un programme ou par un utilisateur. En permettant aux utilisateurs de lancer seulement un petit nombre de processus.</p>
<h2>
<li>Protection</li>
</h2>
<p><em>J&#8217;aborderais uniquement la solution sous linux, sachant que je ne connais que celle la. :)</em></p>
<p>Les systèmes de type Unix permettent de limiter le nombre de processus via la commande ulimit.</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/vous-avez-dit-forkbomb-79/feed/</wfw:commentRss>
<slash:comments>2</slash:comments>
</item>
<item>
<title>Grep !</title>
<link>http://www.crashdump.fr/debian/grep-38/</link>
<comments>http://www.crashdump.fr/debian/grep-38/#comments</comments>
<pubDate>Thu, 19 Jul 2007 20:35:59 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<guid isPermaLink="false">http://blog.aemeth.org/?p=38</guid>
<description>
<![CDATA[Voilà la que l&#8217;on trouve exclusivement sur les systèmes *nux. Très puissante, elle vous permet de créer un masque de recherche&#8230; par exemple: trouver un texte alors que l&#8217;on ne connait pas le fichier d&#8217;où il provient ? Simple: utilisez la commande grep. (les fichiers doivent se trouver dans le même répertoire), pour rechercher la [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Voilà la que l&#8217;on trouve exclusivement sur les systèmes *nux. Très puissante, elle vous permet de créer un masque de recherche&#8230; par exemple: trouver un texte alors que l&#8217;on ne connait pas le fichier d&#8217;où il provient ?</p>
<p>Simple: utilisez la commande grep. (les fichiers doivent se trouver dans le même répertoire), pour rechercher la chaîne &laquo;&nbsp;texte&nbsp;&raquo;, il faut faire :</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">grep texte *</div></td></tr></tbody></table></div>
<p>Sinon, si les fichiers se trouvent dans une arborescence:</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">find . -type f -exec grep texte {} \;</div></td></tr></tbody></table></div>
<p>rechercher à partir du répertoire courant:</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">find .</div></td></tr></tbody></table></div>
<p>on cherche un fichier:</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">-type f</div></td></tr></tbody></table></div>
<p>on execute une commande à chaque fichier trouvé:</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">-exec</div></td></tr></tbody></table></div>
<p>recherche de &laquo;&nbsp;texte&nbsp;&raquo; dans les fichiers ( {} vaut le nom des fichiers trouvés):</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">grep montexte {}</div></td></tr></tbody></table></div>
<p>fin de l&#8217;option exec:</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">\;</div></td></tr></tbody></table></div>
<p>Ceci dit, si vous avec une recherche a faire sur tout le sytème une petite modification sympose:</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">find . -type f -exec grep crashdump.fr echo {} \; 2&gt; /dev/null</div></td></tr></tbody></table></div>
<p>on affiche le chemin du fichier dans lequel a été trouvé le texte</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">echo {}</div></td></tr></tbody></table></div>
<p>vous evitera tous les messages d&#8217;erreurs a propos de permissions non accordées..</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">2&gt; /dev/null</div></td></tr></tbody></table></div>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/grep-38/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>wget, ou comment télécharger des ressources via HTTP ou FTP.</title>
<link>http://www.crashdump.fr/debian/wget-ou-comment-telecharger-des-ressources-via-http-ou-ftp-32/</link>
<comments>http://www.crashdump.fr/debian/wget-ou-comment-telecharger-des-ressources-via-http-ou-ftp-32/#comments</comments>
<pubDate>Wed, 18 Jul 2007 22:01:14 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<guid isPermaLink="false">http://blog.aemeth.org/?p=32</guid>
<description>
<![CDATA[Wget est un utilitaire qui permet de télécharger ce que vous lui demanderez. Sa particularité : il ne se pilote qu’en ligne de commande, ce qui en fait l’outil idéal pour créer des shell scripts. Il me sert tellement souvent que j&#8217;ai pensé qu&#8217;il méritais bien un petit billet. Exemple : téléchargement d’un site web [...]]]>
</description>
<content:encoded>
<![CDATA[<p>Wget est un utilitaire qui permet de télécharger ce que vous lui demanderez. Sa particularité : il ne se pilote qu’en ligne de commande, ce qui en fait l’outil idéal pour créer des shell scripts. Il me sert tellement souvent que j&#8217;ai pensé qu&#8217;il méritais bien un petit billet.</p>
<h2>
<li>Exemple : téléchargement d’un site web</li>
</h2>
<p>Téléchargement en local, tout le site de aemeth.org en une seule ligne :</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">wget -rkpE http://www.crashdump.fr/</div></td></tr></tbody></table></div>
<p><span id="more-32"></span><br />
Explication des options :</p>
<p>-r : récursif</p>
<p>-k : corrige les chemins pour que les liens en local ne soient pas cassés (très utile pour moi qui commence toujours mes liens par un / pour recevnir à la racine du site)</p>
<p>-p : page : se débrouille pour télécharger un max de trucs qui font que la page html sera correctement visible. (j’ai pas tout compris mais ça semble aider à avoir un bon mirroir local)</p>
<p>-E : rajoute .html à la fin de tout ce qui est téléchargé avec un type text/html mais dont le nom ne termine pas par .html. C’est formidable, car cela permet qu’un site tel que le miens, dont les pages n’affichent pas leur extentions, soient consultables off-line, depuis un disque dur.</p>
<p>Voila, en une seule instruction, vous avez téléchargé un site entier.<br />
Télécharger un dossier et ses sous-dossiers</p>
<p>Pour télécharger un site qui se trouverait seulement dans un répertoire, sans déborder de se répertoire, voici l’instruction :</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">wget -rkpE -np http://public.crashdump.fr/bash/</div></td></tr></tbody></table></div>
<p>-np : no-parent : reste à l’intérieur du répertoire donné et n’en déborde pas.<br />
Autres fonctionnalités</p>
<p><strong>wget est vraiment bien foutu car il :</strong><br />
-  comprends ssl et peut donc naviger sur les sites sécurisés<br />
-  comprends les cookies<br />
-  accepte les login/pwd pour se connecter à des sites privés<br />
-  accepte les proxies<br />
-  accepte le time stamping </p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/wget-ou-comment-telecharger-des-ressources-via-http-ou-ftp-32/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Bash &#8230; #5</title>
<link>http://www.crashdump.fr/debian/bash-5-25/</link>
<comments>http://www.crashdump.fr/debian/bash-5-25/#comments</comments>
<pubDate>Thu, 12 Jul 2007 14:53:57 +0000</pubDate>
<dc:creator>Crashdump</dc:creator>
<category>
<![CDATA[Debian]]>
</category>
<category>
<![CDATA[USD]]>
</category>
<guid isPermaLink="false">http://blog.aemeth.org/?p=25</guid>
<description>
<![CDATA[Résumé des épisodes précédents : 1. Le prompt bash et la manipulation des titres des fenêtres 2. Navigation dans les répertoires en ligne de commande et les alias 3. L&#8217;historique et le complètement avancé avec bash 4. Les entrée/sorties, leur redirection et les motifs du shell Ce billets est quant à lui consacré à l&#8217;enchaînement [...]]]>
</description>
<content:encoded>
<![CDATA[<h2>
<li>Résumé des épisodes précédents :</li>
</h2>
<p>   1. <a rel="nofollow" href="?p=8">Le prompt bash et la manipulation des titres des fenêtres</a><br />
   2. <a rel="nofollow" href="?p=10">Navigation dans les répertoires en ligne de commande et les alias</a><br />
   3. <a rel="nofollow" href="?p=11">L&#8217;historique et le complètement avancé avec bash</a><br />
   4. <a rel="nofollow" href="?p=24">Les entrée/sorties, leur redirection et les motifs du shell</a></p>
<p>Ce billets est quant à lui consacré à l&#8217;enchaînement de commandes, au contrôles des tâches (jobs) puis à deux petites astuces bien pratiques à utilisées sans modération. Je pense que ce billet est le dernier de cette série, les prochains autour du shell seront probablement sur les scripts et diverses astuces plus ou moins pointues comme les deux présentées à la fin de ce billet.</p>
<h2>
<li>Enchaîner les commandes</li>
</h2>
<p>L&#8217;utilisation probablement la plus courante d&#8217;un shell consiste à taper une commande, regarder sa sortie ou son résultat et éventuellement recommencer en fonction du résultat précédent. On peut aussi vouloir exécuter plusieurs commandes à la suite. Pour cela, on peut écrire un script ou une fonction bash (ce sera probablement l&#8217;objet d&#8217;une prochaine série de billets) mais il est aussi possible de le faire en mode interactif.<br />
<span id="more-25"></span><br />
<strong>Plusieurs commandes à la suite sans condition</strong></p>
<p>Pour éxécuter plusieurs commandes de suite, il est possible de les écrire les unes à la suite des autres en les séparant par un point-virgule, par exemple :</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 /tmp ; find . -type d -user tigrou &gt; liste_dossiers ; cd ; cat /tmp/liste_dossiers<br />
./orbit-tigrou<br />
./ssh-QSQBhp4238<br />
./gconfd-tigrou<br />
./gconfd-tigrou/lock<br />
./.exchange-tigrou<br />
./listen</div></td></tr></tbody></table></div>
<p>Cette liste de 4 commandes est regroupée sur une ligne, j&#8217;aurais aussi bien pu taper chacune d&#8217;elle sur une ligne séparée, le résultat aurait été le même. Si l&#8217;une d&#8217;entre elles échoue, les autres sont quand même exécutées.</p>
<p><strong>Plusieurs commandes à la suite sous condition</strong></p>
<p>Chaque commande lancée renvoie normalement un code de retour. Par convention, un résultat normal (sans erreur) renvoie un code de retour égale à zéro, si quelque chose se passe mal, ce code est différent de zéro et peu avoir différentes significations selon les programmes. La variable $? contient le code de retour de la précédente commande lancée. En séparant des commandes par &#038;&#038;, bash vérifie que la commande a bien renvoyé un code de retour nulle avant d&#8217;éxécuter la suivante, sinon il interrompt la suite, exemple :</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 /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ test -L /tmp<br />
$ echo $?<br />
1<br />
$ test -e /tmp &amp;&amp; echo &quot;/tmp existe&quot; &amp;&amp; test -L /tmp &amp;&amp; echo &quot;/tmp est un lien symbolique&quot;<br />
/tmp existe</div></td></tr></tbody></table></div>
<p>Cette suite de commande est interrompue après le test -L car son code de retour n&#8217;est pas nulle puisque /tmp n&#8217;est pas un lien symbolique.</p>
<h2>
<li>Contrôle des tâches</li>
</h2>
<p>En ajoutant le caractère &#038; à une commande, celle-ci est lancée en arrière plan tout en restant &laquo;&nbsp;attaché&nbsp;&raquo; au shell qui l&#8217;a lancé. On peut aussi faire passer en arrière plan une commande avec le raccourci Ctrl+z. Pour récupèrer la main sur le programme passé en arrière plan, il est possible d&#8217;utiliser la commande fg . J&#8217;utilise couramment ce mécanisme lorsque j&#8217;édite un fichier à l&#8217;aide de vim en ssh et que je me rend compte que je dois lancer une autre commande, je peux alors faire Ctrl+z pour récupèrer le shell, je lance ma commande puis je tape fg pour reprendre la main sur mon éditeur. fg accepte en paramètre un entier qui indique le numéro de la tâche à remettre en avant plan. Ce numéro correspond à l&#8217;ordre dans lequel les programmes ont été mis en arrière plan.<br />
Quelques trucs&#8230;</p>
<h2>
<li>Un peu de couleurs avec grep</li>
</h2>
<p>Les émulateurs de terminal sont capables d&#8217;afficher quelques couleurs (en général 16). La configuration par défaut sous la plupart des distributions fait en sorte que ls affiche sa sortie avec des couleurs en fonction du type de fichier ou de son extension. D&#8217;autres programmes sont capables d&#8217;améliorer leur affichage avec un peu de couleur.</p>
<p>C&#8217;est par exemple le cas de grep qui permet de filtrer un texte selon une expression rationnelle en mettant en avant les morceaux de texte correspondant au motif, c&#8217;est assez pratique lorsque l&#8217;on tente de déchiffrer un fichier de log ou tout autre fichier texte.</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 .bashrc | egrep --color ' [a-z][a-z]='</div></td></tr></tbody></table></div>
<p>Cette ligne permet d&#8217;obtenir tous les alias de 2 caractères. Ce qui donne dans mon terminal :</p>
<p>Pour que ce comportement soit systématique, il suffit d&#8217;ajouter les lignes suivante dans son fichier ~/.bashrc :</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">alias grep='grep --color=auto'<br />
alias egrep='egrep --color=auto'</div></td></tr></tbody></table></div>
<p>Pour que tout appel à grep (et à egrep) mette en valeur le motif trouvé.</p>
<h2>
<li>Suivre un fichier de log</li>
</h2>
<p>tail est un programme qui propose d&#8217;afficher les n dernières lignes ou les n derniers octets d&#8217;un fichier. Il dispose d&#8217;une option -f (pour follow) très intéressante permettant de suivre un fichier pour faire défiler les dernières lignes ajoutées. Cette option combinée à d&#8217;autres utilitaires de traitement de texte (cut , sed , grep , &#8230;) permet de suivre différents types de journaux facilement, deux exemples courants :</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 /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># suivre les logs d'Apache avec uniquement l'IP du visiteur, la page demandée,<br />
# son navigateur et le référent sans les requêtes pour les images et les feuilles de style<br />
tail -f access.log &nbsp;| egrep -v --line-buffered '(/var|/design|/share)' | cut -d ' ' -f 1,7,12-<br />
# suivre les logs de Postfix des mails rejetés<br />
# avec uniquement la raison du rejet<br />
tail -f mail.log | grep --line-buffered reject | cut -d ' ' -f 8-</div></td></tr></tbody></table></div>
<p>À noter dans ces exemples, l&#8217;ajout du paramètre &#8211;line-buffered pour indiquer à grep de traiter les données ligne par ligne plutôt que par un buffer plus grand. Cette option permet de ne pas avoir de latence entre le moment ou tail écrit une nouvelle ligne et le moment ou grep la traite.</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.crashdump.fr/debian/bash-5-25/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
</channel>
</rss>
<!-- Served from: www.crashdump.fr @ 2012-05-18 13:24:41 by W3 Total Cache -->
