<?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>Astuces d&#039;Absolacom &#187; memo</title>
	<atom:link href="http://astuces.absolacom.com/tag/memo/feed/" rel="self" type="application/rss+xml" />
	<link>http://astuces.absolacom.com</link>
	<description>La voie est libre mais pleine d&#039;achoppements</description>
	<lastBuildDate>Wed, 01 Feb 2012 17:59:43 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Chainloader windows avec grub</title>
		<link>http://astuces.absolacom.com/non-classe/chainloader-windows-avec-grub/</link>
		<comments>http://astuces.absolacom.com/non-classe/chainloader-windows-avec-grub/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 16:09:57 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[logiciel]]></category>
		<category><![CDATA[Non classé]]></category>
		<category><![CDATA[planet-libre]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=309</guid>
		<description><![CDATA[Pour mémo et m&#8217;éviter de chercher à chaque fois, pour ajouter une entrée pour windows après avoir installé slitaz, il faut éditer le fichier /boot/grub/menu.lst et ajouter ceci: title Windows rootnoverify (hd0,0) makeactive chainloader +1]]></description>
			<content:encoded><![CDATA[<p>Pour mémo et m&#8217;éviter de chercher à chaque fois, pour ajouter une entrée pour<br />
windows après avoir installé  slitaz, il faut éditer le fichier /boot/grub/menu.lst et ajouter ceci:</p>
<pre>title Windows
        rootnoverify (hd0,0)
        makeactive
        chainloader +1</pre>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/non-classe/chainloader-windows-avec-grub/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Réinitialiser le mot de passe root sur MySQL</title>
		<link>http://astuces.absolacom.com/linux/reinitialiser-le-mot-de-passe-root-sur-mysql/</link>
		<comments>http://astuces.absolacom.com/linux/reinitialiser-le-mot-de-passe-root-sur-mysql/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 09:19:28 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[planet-libre]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[serveur]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=304</guid>
		<description><![CDATA[&#171;&#160;La force de la mémoire, c&#8217;est d&#8217;oublier&#160;&#187; Mais parfois, c&#8217;est embêtant&#8230; Vous administrez un serveur MySQL sur un base Debian et vous avez oublié le mot de passe de root pour accèder à phpmyadmin? Pas de panique! Suivez ces instructions: cat /etc/mysql/debian.cnf Relevez le mot de passe donné dans ce fichier. Allez sur votre interface [...]]]></description>
			<content:encoded><![CDATA[<h1>&laquo;&nbsp;La force de la mémoire, c&#8217;est d&#8217;oublier&nbsp;&raquo;</h1>
<p>Mais parfois, c&#8217;est embêtant&#8230;</p>
<p>Vous administrez un serveur MySQL sur un base Debian et vous avez oublié le mot de passe de root pour accèder à phpmyadmin? Pas de panique!</p>
<p>Suivez ces instructions:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>debian.cnf</pre></div></div>

<p>Relevez le mot de passe donné dans ce fichier.</p>
<p>Allez sur votre interface <em>phpmyadmin</em> et utilisez l&#8217;utilisateur <strong>debian-sys-maint</strong> avec le mot de passe relevé ci dessus.<br />
Ensuite, grâce au lien privilèges, allez modifiez le mot de passe voulu.</p>
<p>Le fichier <em>/etc/mysql/debian.cnf </em>possède les droits en 600 et appartient à <strong>root</strong>. Il n&#8217;est donc pas lisible par un autre utilisateur.</p>
<p>Cette méthode rapide et facile ne fonctionne que sur les bases Debian. Pour les autres, ou si celle ci ne fonctionne pas, il faudra utiliser les méthodes classiques, comme par exemple <a href="http://www.digital-connexion.info/index.php/post/2007/05/18/Comment-changer-un-mot-de-passe-Mysql-oublie" target="_blank">celle ci</a></p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/linux/reinitialiser-le-mot-de-passe-root-sur-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recevoir le log de rkhunter</title>
		<link>http://astuces.absolacom.com/systeme/recevoir-le-log-de-rkhunter/</link>
		<comments>http://astuces.absolacom.com/systeme/recevoir-le-log-de-rkhunter/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 22:53:29 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[logiciel]]></category>
		<category><![CDATA[planet-libre]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[système]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=214</guid>
		<description><![CDATA[Par défaut, rkhunter envoi un compte rendu succint lors de son lancement automatique. Avouez qu&#8217;il serait quand même plus pratique de recevoir le log au lieu d&#8217;une simple phrase &#171;&#160;Please inspect this machine, because it may be infected.&#160;&#187;. Heureusement, il est possible de modifier simplement ce comportement. En root, éditez le fichier /etc/cron.daily/rkhunter. Modifiez la [...]]]></description>
			<content:encoded><![CDATA[<p>Par défaut, rkhunter envoi un compte rendu succint lors de son lancement automatique.</p>
<p>Avouez qu&#8217;il serait quand même plus pratique de recevoir le log au lieu d&#8217;une simple phrase &laquo;&nbsp;Please inspect this machine, because it may be infected.&nbsp;&raquo;.</p>
<p>Heureusement, il est possible de modifier simplement ce comportement.</p>
<p>En root, éditez le fichier /etc/cron.daily/rkhunter.</p>
<p>Modifiez la ligne:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">...
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">nice</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$NICE</span> <span style="color: #007800;">$RKHUNTER</span> <span style="color: #660033;">--cronjob</span> <span style="color: #660033;">--report-warnings-only</span> \
<span style="color: #660033;">--createlogfile</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>rkhunter.log <span style="color: #007800;">$RK_OPT</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$OUTFILE</span>
...</pre></div></div>

<p>pour qu&#8217;elle ressemble à celle ci</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">...
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">nice</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$NICE</span> <span style="color: #007800;">$RKHUNTER</span> <span style="color: #660033;">--cronjob</span> <span style="color: #660033;">--report-warnings-only</span> \
<span style="color: #660033;">--createlogfile</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>rkhunter.log <span style="color: #660033;">--display-logfile</span> <span style="color: #007800;">$RK_OPT</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$OUTFILE</span>
...</pre></div></div>

<p>Au prochain lancement automatique, si vous avez paramétré rkhunter pour qu&#8217;il vous envoie un mail, vous recevrez en plus le log du scan.</p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/systeme/recevoir-le-log-de-rkhunter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filtrer les connexions ssh</title>
		<link>http://astuces.absolacom.com/ubuntu/filtrer-les-connexions-ssh/</link>
		<comments>http://astuces.absolacom.com/ubuntu/filtrer-les-connexions-ssh/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 19:14:24 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[logiciel]]></category>
		<category><![CDATA[planet-libre]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=184</guid>
		<description><![CDATA[Portier SSH Si vous possédez un serveur avec SSH opérationnel, vous ne serez pas long à avoir des messages tels que ceux ci dans le fichier /var/log/auth.log: ... Mar 11 12:48:21 serv sshd&#91;12956&#93;: Failed password for invalid user root from 64.71.148.162 port 47270 ssh2 Mar 11 15:45:04 serv sshd&#91;6954&#93;: Did not receive identification string from [...]]]></description>
			<content:encoded><![CDATA[<h2>Portier SSH</h2>
<p>Si vous possédez un serveur avec SSH opérationnel, vous ne serez pas long à avoir des messages tels que ceux ci dans le fichier <em>/var/log/auth.log</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">...
Mar <span style="color: #000000;">11</span> <span style="color: #000000;">12</span>:<span style="color: #000000;">48</span>:<span style="color: #000000;">21</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">12956</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Failed password <span style="color: #000000; font-weight: bold;">for</span> invalid user root from 64.71.148.162 port <span style="color: #000000;">47270</span> ssh2
Mar <span style="color: #000000;">11</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">45</span>:04 serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">6954</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Did not receive identification string from 210.21.30.72
Mar <span style="color: #000000;">11</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">46</span>:<span style="color: #000000;">48</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7041</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Did not receive identification string from 81.93.188.5
Mar <span style="color: #000000;">11</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">50</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7106</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: User root from 210.21.30.72 not allowed because none of user s <span style="color: #c20cb9; font-weight: bold;">groups</span> are listed <span style="color: #000000; font-weight: bold;">in</span> AllowGroups
Mar <span style="color: #000000;">11</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">50</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7106</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: pam_unix<span style="color: #7a0874; font-weight: bold;">&#40;</span>sshd:auth<span style="color: #7a0874; font-weight: bold;">&#41;</span>: authentication failure; <span style="color: #007800;">logname</span>= <span style="color: #007800;">uid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">euid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">tty</span>=<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">ruser</span>= <span style="color: #007800;">rhost</span>=210.21.30.72  <span style="color: #007800;">user</span>=root
Mar <span style="color: #000000;">11</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">52</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7106</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Failed password <span style="color: #000000; font-weight: bold;">for</span> invalid user root from 210.21.30.72 port <span style="color: #000000;">54346</span> ssh2
Mar <span style="color: #000000;">11</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">49</span>:<span style="color: #000000;">33</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7241</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: User root from 81.93.188.5 not allowed because none of user s <span style="color: #c20cb9; font-weight: bold;">groups</span> are listed <span style="color: #000000; font-weight: bold;">in</span> AllowGroups
Mar <span style="color: #000000;">11</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">49</span>:<span style="color: #000000;">33</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7241</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: pam_unix<span style="color: #7a0874; font-weight: bold;">&#40;</span>sshd:auth<span style="color: #7a0874; font-weight: bold;">&#41;</span>: authentication failure; <span style="color: #007800;">logname</span>= <span style="color: #007800;">uid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">euid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">tty</span>=<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">ruser</span>= <span style="color: #007800;">rhost</span>=81.93.188.5  <span style="color: #007800;">user</span>=root
Mar <span style="color: #000000;">11</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">49</span>:<span style="color: #000000;">35</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7241</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Failed password <span style="color: #000000; font-weight: bold;">for</span> invalid user root from 81.93.188.5 port <span style="color: #000000;">44663</span> ssh2
Mar <span style="color: #000000;">12</span> 00:<span style="color: #000000;">51</span>:<span style="color: #000000;">18</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">22229</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: User root from host.ongamemarketing.com not allowed because none of user s <span style="color: #c20cb9; font-weight: bold;">groups</span> are listed <span style="color: #000000; font-weight: bold;">in</span> AllowGroups
Mar <span style="color: #000000;">12</span> 00:<span style="color: #000000;">51</span>:<span style="color: #000000;">18</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">22229</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: pam_unix<span style="color: #7a0874; font-weight: bold;">&#40;</span>sshd:auth<span style="color: #7a0874; font-weight: bold;">&#41;</span>: authentication failure; <span style="color: #007800;">logname</span>= <span style="color: #007800;">uid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">euid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">tty</span>=<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">ruser</span>= <span style="color: #007800;">rhost</span>=host.ongamemarketing.com  <span style="color: #007800;">user</span>=root
Mar <span style="color: #000000;">12</span> 00:<span style="color: #000000;">51</span>:<span style="color: #000000;">20</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">22229</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Failed password <span style="color: #000000; font-weight: bold;">for</span> invalid user root from 174.133.12.130 port <span style="color: #000000;">48089</span> ssh2
Mar <span style="color: #000000;">12</span> 00:<span style="color: #000000;">51</span>:<span style="color: #000000;">22</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">22236</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: User root from host.ongamemarketing.com not allowed because none of user s <span style="color: #c20cb9; font-weight: bold;">groups</span> are listed <span style="color: #000000; font-weight: bold;">in</span> AllowGroups
Mar <span style="color: #000000;">12</span> 00:<span style="color: #000000;">51</span>:<span style="color: #000000;">22</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">22236</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: pam_unix<span style="color: #7a0874; font-weight: bold;">&#40;</span>sshd:auth<span style="color: #7a0874; font-weight: bold;">&#41;</span>: authentication failure; <span style="color: #007800;">logname</span>= <span style="color: #007800;">uid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">euid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">tty</span>=<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">ruser</span>= <span style="color: #007800;">rhost</span>=host.ongamemarketing.com  <span style="color: #007800;">user</span>=root
Mar <span style="color: #000000;">12</span> 00:<span style="color: #000000;">51</span>:<span style="color: #000000;">24</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">22236</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Failed password <span style="color: #000000; font-weight: bold;">for</span> invalid user root from 174.133.12.130 port <span style="color: #000000;">48521</span> ssh2
Mar <span style="color: #000000;">12</span> 01:<span style="color: #000000;">47</span>:<span style="color: #000000;">10</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">30827</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Did not receive identification string from 114.200.199.144
Mar <span style="color: #000000;">12</span> 01:<span style="color: #000000;">53</span>:<span style="color: #000000;">17</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">31227</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Invalid user staff from 114.200.199.144
Mar <span style="color: #000000;">12</span> 01:<span style="color: #000000;">53</span>:<span style="color: #000000;">17</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">31227</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: pam_unix<span style="color: #7a0874; font-weight: bold;">&#40;</span>sshd:auth<span style="color: #7a0874; font-weight: bold;">&#41;</span>: check pass; user unknown
Mar <span style="color: #000000;">12</span> 01:<span style="color: #000000;">53</span>:<span style="color: #000000;">17</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">31227</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: pam_unix<span style="color: #7a0874; font-weight: bold;">&#40;</span>sshd:auth<span style="color: #7a0874; font-weight: bold;">&#41;</span>: authentication failure; <span style="color: #007800;">logname</span>= <span style="color: #007800;">uid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">euid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">tty</span>=<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">ruser</span>= <span style="color: #007800;">rhost</span>=114.200.199.144
Mar <span style="color: #000000;">12</span> 01:<span style="color: #000000;">53</span>:<span style="color: #000000;">19</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">31227</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Failed password <span style="color: #000000; font-weight: bold;">for</span> invalid user staff from 114.200.199.144 port <span style="color: #000000;">35343</span> ssh2
Mar <span style="color: #000000;">12</span> 01:<span style="color: #000000;">53</span>:<span style="color: #000000;">27</span> serv sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">31234</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Invalid user sales from 114.200.199.144
...</pre></div></div>

<p>Vous avez besoin de pouvoir vous connecter en ssh depuis le réseau local, depuis l&#8217;extérieur, mais vous voulez limiter les risques. Il existe plusieurs solutions, qui peuvent être cumulées:</p>
<h2>Sécuriser par la configuration de SSH</h2>
<h3>N&#8217;autoriser QUE certains utilisateurs à accéder au service</h3>
<p>Si vous avez peu d&#8217;utilisateurs nécessitant un accès ssh, vous pouvez les déclarer ainsi en ajoutant cette ligne dans le fichier de configuration <em>/etc/ssh/sshd_config </em>(et en redémarrant le service après chaque modification<em>)<br />
</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">AllowUsers titi toto</pre></div></div>

<p>Après relance du service ssh, les utilisateurs <em>titi</em> et <em>toto</em> pourront se connecter en ssh, les autres utilisateurs se verront refuser leur mot de passe.</p>
<p>Vous pouvez aussi créer un groupe (par exemple: <em>sshusers</em>) et autoriser tous les utilisateurs de ce groupe à se connecter en ssh. Ceux n&#8217;appartenant pas à ce groupe se verront refuser leur mot de passe.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">addgroup sshusers
adduser toto sshusers
adduser titi sshusers</pre></div></div>

<p>Puis ajoutez la ligne suivante dans /etc/ssh/sshd_config:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">AllowGroups sshusers</pre></div></div>

<h3>IN and OUT</h3>
<p>Oui, mais voilà un nouveau problème:</p>
<ol>
<li> Le serveur fait passerelle avec internet, et possède une carte sur le réseau interne, et une carte vers le réseau internet.</li>
<li> Tous mes utilisateurs internes doivent pouvoir accéder par ssh (ce qui est le cas avec la configuration par défaut), mais ne doivent pas pouvoir accéder depuis l&#8217;extérieur (parce qu&#8217;ils n&#8217;en ont pas besoin, ou parce que les mots de passe des utilisateurs sont trop simples)</li>
<li> Si je laisse la configuration ainsi, le serveur sera piraté très rapidement.</li>
</ol>
<p>Il est possible d&#8217;ajouter une directive à la liste des autorisations, permettant de faire ceci:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">AllowUsers <span style="color: #000000; font-weight: bold;">*@</span>192.168.0.<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>Ainsi, tous les utilisateurs du réseau local (et possédant un compte sur le serveur) pourront accéder par ssh, mais ne pourront pas le faire s&#8217;ils ne proviennent pas du réseau local (par internet).<br />
Si je veux pouvoir ensuite me connecter depuis l&#8217;internet pour faire de la télémaintenance, il me suffit d&#8217;ajouter mon compte et de transformer la ligne en ceci:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">AllowUsers manu <span style="color: #000000; font-weight: bold;">*@</span>192.168.0.<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>(1)</p>
<p>Il est possible aussi de cumuler les directives Users et Groups pour obtenir des possibilités supplémentaires. Exemple:</p>
<ol>
<li>Seuls certains de mes utilisateurs locaux doivent pouvoir se connecter au serveur, depuis le net ou en local.</li>
<li>Je veux pouvoir m&#8217;y connecter de partout (local et internet)</li>
</ol>
<p>La configuration est la suivante:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">AllowGroups sshusers
AllowUsers manu</pre></div></div>

<p>Ainsi, seuls les utilisateurs appartenant au groupe sshusers pourront se connecter au serveur, en plus de l&#8217;utilisateur manu qui pourra se connecter depuis n&#8217;importe où.</p>
<p>Si je possède un adresse IP fixe, et que je suis assez bête pour crée un compte manu avec le mot de passe manu, je peux tout de même limiter l&#8217;accès par mon adresse IP (80.80.80.80)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">AllowUsers <span style="color: #000000; font-weight: bold;">@</span>80.80.80.80</pre></div></div>

<h3>Je suis désolé, ça va pas être possible&#8230;</h3>
<p>Vous pouvez même ajouter des directives inverses, pour interdire les connexions:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">DenyUsers invite
DenyGroups stagiaires</pre></div></div>

<h3>Autres configurations conseillées de ssh</h3>
<p>Vous pouvez modifier d&#8217;autres éléments du fichier de configuration, qui permettront de sécuriser un peu plus votre serveur ssh:</p>
<ul>
<li> <strong>Changer le port d&#8217;écoute par défaut: </strong>vous pouvez changer ce port par autre chose que 22. Sachez cependant que la protection apportée par ce changement est TRÈS FAIBLE. Un scan de vos port repérera le port que vous avez choisi, et des logiciels de scans sont capable de déterminer le service qui tourne derrière ce port. Cela vous permettra seulement d&#8217;échapper à certains robots qui ne tentent des connexions que sur le port 22.</li>
<li><strong><a title="SSH sans mot de passe" href="http://www.lea-linux.org/documentations/index.php/Trucs:Connection_SSH_sans_mot_de_passe" target="_blank">N&#8217;autoriser une identification que par clef</a>:</strong> il vous faudra générer des clefs d&#8217;identification (avec seahorse pour gnome ou ssk-keygen) pour tous vos utilisateurs et empêcher l&#8217;autentification par mot de passe dans la configuration de SSH. Cette protection est très efficace, par contre, il faut que les clefs soient sécurisées (pas sur une clef usb qui peut se perdre ou se faire voler, pas sur un partage accessible, pas échangées par courriel, &#8230;). L&#8217;autre inconvénient, c&#8217;est que vos clefs doivent voyager avec vous et être installées sur les ordinateurs que vous utilisez; d&#8217;où une incompatibilité avec le point précédent, si vous n&#8217;avez pas une politique stricte de stockage des clefs.</li>
<li><strong>Ne JAMAIS autoriser la connexion de l&#8217;utilisateur root: </strong>(PermitRootLogin no).  Il y a toujours un utilisateur root sur tous les Linux (<span style="text-decoration: underline;">même sur Ubuntu</span>) et vous facilitez le travail d&#8217;un éventuel pirate, puisqu&#8217;il n&#8217;a qu&#8217;un mot de passe à trouver. Autrement, il doit d&#8217;abord trouver un login valide, puis son mot de passe, puis celui du root. Si vos mots de passe et vos logins sont adaptés, cela lui prendra des années avant d&#8217;y arriver par ce moyen.</li>
</ul>
<h2>Ajouter des logiciels de sécurisation</h2>
<h3>fail2ban</h3>
<p><a title="Site de fail2ban" href="http://www.fail2ban.org/wiki/index.php/Main_Page" target="_blank">fail2ban</a> est un logiciel qui va surveiller les tentatives de connexion échouées dans le fichier<em> /var/log/auth.log</em> , et bloquer, en modifiant les règles iptables à la volée, un nombre trop élevé de connexions échouées. Ce logiciel permet aussi, de la même manière, de protéger votre serveur apache, postfix, vsftpd, proftpd, wuftpd, sasl, dns, &#8230;<br />
Une fois installé, il vous suffit d&#8217;éditer le fichier <em>/etc/fail2ban/jail.conf</em> pour configurer son comportement. Exemple pour ssh:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">...
<span style="color: #7a0874; font-weight: bold;">&#91;</span>DEFAULT<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #666666; font-style: italic;"># &quot;ignoreip&quot; can be an IP address, a CIDR mask or a DNS host</span>
ignoreip = <span style="color: #000000; font-weight: bold;">&lt;</span>a <span style="color: #007800;">class</span>=<span style="color: #ff0000;">&quot;linkification-ext&quot;</span> <span style="color: #007800;">title</span>=<span style="color: #ff0000;">&quot;Linkification: http://10.0.0.0/24&quot;</span> <span style="color: #007800;">href</span>=<span style="color: #ff0000;">&quot;http://10.0.0.0/24&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>10.0.0.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span><span style="color: #000000; font-weight: bold;">&lt;/</span>a<span style="color: #000000; font-weight: bold;">&gt;</span>
bantime  = <span style="color: #000000;">600</span>
maxretry = <span style="color: #000000;">3</span>
...
<span style="color: #7a0874; font-weight: bold;">&#91;</span>SECTION_NAME<span style="color: #7a0874; font-weight: bold;">&#93;</span>
enabled = <span style="color: #c20cb9; font-weight: bold;">true</span> <span style="color: #666666; font-style: italic;"># vérifier que cette valeur est à True, sinon le logiciel n'est pas activé!</span>
...
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">ssh</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
enabled = <span style="color: #c20cb9; font-weight: bold;">true</span>
port	= <span style="color: #c20cb9; font-weight: bold;">ssh</span>
filter	= sshd
logpath  = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>auth.log
maxretry = <span style="color: #000000;">6</span></pre></div></div>

<p>Dans cette configuration:</p>
<ul>
<li>Tout ce qui vient du réseau local (<a class="linkification-ext" title="Linkification: http://10.0.0.0/24" href="http://10.0.0.0/24">10.0.0.0/24</a>) est ignoré. Donc je pourrais me tromper autant de fois que voulu, je ne me ferais pas bannir.</li>
<li>En dehors de mon réseau local, par ssh, j&#8217;ai droit à 6 tentatives (par session) de connexions échouées. Ensuite, je me ferais bannir. Si je m&#8217;identifie, la fois suivante, j&#8217;ai encore droit à 6 tentative (ça repart à zéro avec l&#8217;identification réussie)</li>
<li>Si je suis banni, toutes mes tentatives de connexions pendant les 600 prochaines secondes (10 minutes) seront refusées, sans possibilité d&#8217;identification.</li>
</ul>
<p>La configuration de fail2ban vous offre plein d&#8217;autres possibilité, comme de recevoir des mails en cas de tentatives échouées, d&#8217;utilisateurs inconnus, etc. Consultez la documentation pour exploiter cet outils très pratique.</p>
<h3>denyhosts</h3>
<p><a href="http://www.howtoforge.com/preventing_ssh_dictionary_attacks_with_denyhosts" target="_blank">denyhosts</a> permet de faire la même chose, un peu différemment. Il maintient une base d&#8217;IP bannies dans <em>/etc/hosts.deny</em> et les compare avec les tentatives de connexions.</p>
<p>Il a quelques avantages sur fail2ban, même si je le trouve plus lent (consommateur) à l&#8217;usage:</p>
<ol>
<li>Il permet de bloquer les tentatives d&#8217;accès ssh sur l&#8217;utilisateur root dès la première tentative.</li>
<li>Il permet de paramétrer comme on le veut les champs from et subject des mails envoyés</li>
<li>Il permet d&#8217;envoyer les rapports vers le syslog, qui peut être distant (et ineffaçable)</li>
</ol>
<p>Simple à configurer, le fichier<em> /etc/denyhosts.conf</em> est largement commenté</p>
<h2>Sur le même sujet:</h2>
<ul>
<li><a href="http://www.fail2ban.org/wiki/index.php/FAQ_french" target="_blank">http://www.fail2ban.org/wiki/index.php/FAQ_french</a></li>
<li><a href="http://doc.ubuntu-fr.org/denyhosts" target="_blank">http://doc.ubuntu-fr.org/denyhosts</a></li>
<li><a href="http://www.alsacreations.com/tuto/lire/622-Securite-firewall-iptables.html" target="_blank">http://www.alsacreations.com/tuto/lire/622-Securite-firewall-iptables.html</a></li>
<li><a href="http://senseya.free.fr/index.php?tag/fail2ban" target="_blank">http://senseya.free.fr/index.php?tag/fail2ban</a></li>
</ul>
<p>(1) Ne pensez pas que je suis assez bête pour utiliser un login simple tel que &laquo;&nbsp;manu&nbsp;&raquo; sur mes serveurs&#8230; C&#8217;est juste pour l&#8217;exemple.</p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/ubuntu/filtrer-les-connexions-ssh/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>rkhunter et unhide</title>
		<link>http://astuces.absolacom.com/serveur/rkhunter-et-unhide/</link>
		<comments>http://astuces.absolacom.com/serveur/rkhunter-et-unhide/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 14:49:06 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[planet-libre]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[système]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=189</guid>
		<description><![CDATA[Unhide est un utilitaire permettant de lister les processus actifs cachés. C&#8217;est un outil qui vous permet de trouver d&#8217;éventuels rootkits installés sur votre système. S&#8217;il n&#8217;est pas installé par défaut sur votre distribution, installez le de manière classique. Si vous utilisez rkhunter pour scanner votre machine, sans opération particulière vous aurez deux problèmes: rkhunter [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.security-projects.com/?Unhide" target="_blank">Unhide</a> est un utilitaire permettant de lister les processus actifs cachés. C&#8217;est un outil qui vous permet de trouver d&#8217;éventuels <a href="http://fr.wikipedia.org/wiki/Rootkit" target="_blank">rootkits</a> installés sur votre système.</p>
<p>S&#8217;il n&#8217;est pas installé par défaut sur votre distribution, installez le de manière classique.</p>
<p>Si vous utilisez <a href="http://fr.wikipedia.org/wiki/Rkhunter" target="_blank">rkhunter</a> pour scanner votre machine, sans opération particulière vous aurez deux problèmes:</p>
<ol>
<li>rkhunter n&#8217;utilisera pas par défaut unhide, et vous perdrez donc le bénéfice d&#8217;un seul scan.</li>
<li>rkhunter va détecter un warning sur unhide et unhide-linux26, ce qui vous enverra un mail à chaque détection.</li>
</ol>
<p>La solution est simple: il suffit d&#8217;indiquer à rkhunter que unhide est fiable, en l&#8217;ajoutant à sa base de donnée. Ensuite, rkhunter utilisera unhide automatiquement.</p>
<p><span style="color: #ff0000;"><strong>ATTENTION: n&#8217;utilisez la commande suivante QUE SI VOUS ÊTES SÛR de votre système ! En effet, cette commande va réinitialiser la base de données des programmes considérés comme sûrs par rkhunter. Si vous avez un rootkit ou des programmes cachés, ils ne seront plus détectés!</strong></span></p>
<p><span style="color: #ff0000;"><strong>Il est conseillé de lancer un <em>rkhunter -c</em> et de vérifier le rapport avant de lancer la commande suivante.</strong></span></p>
<p>Maintenant que vous êtes prévenus, voici la commande magique (en root ou avec sudo):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rkhunter <span style="color: #660033;">--propupd</span></pre></div></div>

<p>C&#8217;est tout. La prochaine fois que rkhunter sera lancé, manuellement ou par la programmation, unhide sera détecté et utilisé.</p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/serveur/rkhunter-et-unhide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changer les applications par défaut dans Gnome</title>
		<link>http://astuces.absolacom.com/ubuntu/changer-les-applications-par-defaut-dans-gnome/</link>
		<comments>http://astuces.absolacom.com/ubuntu/changer-les-applications-par-defaut-dans-gnome/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 16:00:15 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[logiciel]]></category>
		<category><![CDATA[planet-libre]]></category>
		<category><![CDATA[système]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=158</guid>
		<description><![CDATA[Lorsque vous introduisez pour la première fois un CD audio dans votre lecteur, Gnome vous demande avec quelle application l&#8217;ouvrir. Vous pouvez même lui demander, en cochant la case,  de s&#8217;en souvenir pour la prochaine fois. Mais si vous désirez changer d&#8217;application, comment faut il faire ? Encore une fois, avec le libre, c&#8217;est simple [...]]]></description>
			<content:encoded><![CDATA[<p>Lorsque vous introduisez pour la première fois un CD audio dans votre lecteur, Gnome vous demande avec quelle application l&#8217;ouvrir. Vous pouvez même lui demander, en cochant la case,  de s&#8217;en souvenir pour la prochaine fois.</p>
<div id="attachment_181" class="wp-caption aligncenter" style="width: 310px"><a href="http://astuces.absolacom.com/wp-content/uploads/2009/03/application-par-defaut.png"><img class="size-medium wp-image-181" title="application-par-defaut" src="http://astuces.absolacom.com/wp-content/uploads/2009/03/application-par-defaut-300x201.png" alt="application-par-defaut" width="300" height="201" /></a><p class="wp-caption-text">application-par-defaut</p></div>
<p>Mais si vous désirez changer d&#8217;application, comment faut il faire ? Encore une fois, avec le libre, c&#8217;est simple si vous savez où aller chercher l&#8217;information.</p>
<p>La liste des associations entre les type de fichiers et les applications à lancer se trouvent dans le fichier <em>~/.local/share/applications/mimeapps.list</em> (ces dossiers et fichiers ne sont présents qu&#8217;une fois que vous avez créé au moins une association)</p>
<p>Ce fichier se compose ainsi:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Added Associations<span style="color: #7a0874; font-weight: bold;">&#93;</span>
x-content<span style="color: #000000; font-weight: bold;">/</span>audio-cdda=vlc.desktop;</pre></div></div>

<p>Si je désire changer l&#8217;application associée aux fichiers audio CD, il me suffit de modifier le fichier pour lui donner le nom du lanceur de l&#8217;application voulue.</p>
<p>Voici un autre exemple de fichier sur un ordinateur utilisé quotidiennement:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Added Associations<span style="color: #7a0874; font-weight: bold;">&#93;</span>
application<span style="color: #000000; font-weight: bold;">/</span>x-shellscript=userapp-kwrite-MEM3AU.desktop;gedit.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-extension-inf=gedit.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-designer=userapp-designer-qt4-YG48AU.desktop;
text<span style="color: #000000; font-weight: bold;">/</span>x-python=userapp-wing-<span style="color: #000000;">101</span>-<span style="color: #000000;">3.1</span>-NFH9NU.desktop;userapp-wing-<span style="color: #000000;">101</span>-<span style="color: #000000;">3.1</span>-SGDVNU.desktop;gedit.desktop;userapp-python-CDV5AU.desktop;
video<span style="color: #000000; font-weight: bold;">/</span>x-mng=gimp.desktop;
image<span style="color: #000000; font-weight: bold;">/</span>svg+<span style="color: #007800;">xml</span>=inkscape.desktop;
audio<span style="color: #000000; font-weight: bold;">/</span>x-vorbis+<span style="color: #007800;">ogg</span>=userapp-audacity-ENNGCU.desktop;
image<span style="color: #000000; font-weight: bold;">/</span>x-ico=gimp.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-executable=userapp-wine-HQHEDU.desktop;userapp-bash-V6E5CU.desktop;
application<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">msword</span>=ooo-writer.desktop;kwrite.desktop;gedit.desktop;
application<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">pdf</span>=userapp-kpdf-8V7VLU.desktop;evince.desktop;gimp.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-cd-image=userapp-vlc-Z4WYDU.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-extension-<span style="color: #000000;">2008</span>=eog.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>octet-stream=eog.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-dia-diagram=dia-common.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-extension-dat=gedit.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-extension-QCM=ooo-template.desktop;
text<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">html</span>=firefox.desktop;geany.desktop;
text<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">css</span>=geany.desktop;
image<span style="color: #000000; font-weight: bold;">/</span>x-xcf=
image<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">png</span>=eog.desktop;
text<span style="color: #000000; font-weight: bold;">/</span>x-gettext-translation=poedit.desktop;userapp-poedit-8NECLU.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-flash-video=vlc.desktop;totem.desktop;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Removed Associations<span style="color: #7a0874; font-weight: bold;">&#93;</span>
application<span style="color: #000000; font-weight: bold;">/</span>x-shellscript=ooo-writer.desktop;wine.desktop;userapp-wine-HQHEDU.desktop;userapp-kwrite-3738AU.desktop;kde-kate.desktop;kde-kwrite.desktop;
text<span style="color: #000000; font-weight: bold;">/</span>x-python=ooo-writer.desktop;wine.desktop;userapp-wine-HQHEDU.desktop;userapp-eclipse-0HNYBU.desktop;
application<span style="color: #000000; font-weight: bold;">/</span>x-dia-diagram=opera.desktop;firefox.desktop;thunderbird.desktop;kde-kfmclient_html.desktop;geany.desktop;gedit.desktop;
image<span style="color: #000000; font-weight: bold;">/</span>x-xcf=userapp-inkscape-0BW2KU.desktop;
image<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">png</span>=inkscape.desktop;
text<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">html</span>=kwrite.desktop;ooo-writer.desktop;thunderbird.desktop;</pre></div></div>

<p>Vous pouvez noter qu&#8217;on peut associer plusieurs applications à un type de fichier: ce seront les applications lancées si vous double cliquez sur un fichier. Si la première n&#8217;est pas trouvée, la deuxième sera lancée, et ainsi de suite.</p>
<p>Cette liste d&#8217;applications est celle que vous pouvez voir si vous faites un clic droit sur un fichier, que vous choisissez <strong>Propriétés</strong> et que vous allez dans l&#8217;onglet <strong>Ouvrir avec</strong>.</p>
<div id="attachment_180" class="wp-caption aligncenter" style="width: 310px"><a href="http://astuces.absolacom.com/wp-content/uploads/2009/03/liste-des-applications-pour-html.png"><img class="size-medium wp-image-180" title="liste-des-applications-pour-html" src="http://astuces.absolacom.com/wp-content/uploads/2009/03/liste-des-applications-pour-html-300x193.png" alt="liste-des-applications-pour-html" width="300" height="193" /></a><p class="wp-caption-text">liste-des-applications-pour-html</p></div>
<p>Si vous supprimez une des applications de la liste proposée (en cliquant sur le bouton <em>Enlever</em> de cette fenêtre), cette suppression d&#8217;association sera notée dans la liste <em>[Removed Associations]</em> du fichier  <em>~/.local/share/applications/mimeapps.list.</em> Par exemple, nous voyons dans le fichier ci dessus (ligne 31) que les images au format png ne doivent pas être ouvertes avec le logiciel inskape.</p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/ubuntu/changer-les-applications-par-defaut-dans-gnome/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Utilisation de Bazaar</title>
		<link>http://astuces.absolacom.com/ubuntu/utilisation-de-bazaar/</link>
		<comments>http://astuces.absolacom.com/ubuntu/utilisation-de-bazaar/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 15:00:00 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[developpement]]></category>
		<category><![CDATA[logiciel]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[bazaar]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[programmation]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=98</guid>
		<description><![CDATA[Bazaar est un gestionnaire de version. L&#8217;un de ses avantages est qu&#8217;il permet d&#8217;utiliser les protocoles ssh ou ftp, ce qui signifie qu&#8217;il n&#8217;est pas nécessaire de monter un &#171;&#160;serveur&#160;&#187; bazaar pour l&#8217;utiliser; il suffit d&#8217;un serveur où vous pouvez vous connecter en ssh. Classement des dossiers L&#8217;organisation des dossiers est laissée à votre goût, [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Bazaar" href="http://doc.ubuntu-fr.org/bazaar" target="_blank">Bazaar</a> est un gestionnaire de version. L&#8217;un de ses avantages est qu&#8217;il permet d&#8217;utiliser les protocoles ssh ou ftp, ce qui signifie qu&#8217;il n&#8217;est pas nécessaire de monter un &laquo;&nbsp;serveur&nbsp;&raquo; bazaar pour l&#8217;utiliser; il suffit d&#8217;un serveur où vous pouvez vous connecter en ssh.</p>
<h2>Classement des dossiers</h2>
<p>L&#8217;organisation des dossiers est laissée à votre goût, mais pour simplifier les explications, voici l&#8217;organisation que nous allons adopter sur le serveur:</p>
<ul>
<li>Un dossier à la racine nommé <em>bzr</em> qui contiendra les divers projets à versionner</li>
<li>Un dossier par projet dans le dossier /bzr (<em>projet1</em> et <em>projet2</em> )</li>
<li>Les droits en lecture/écriture pour les membres du groupe <em>projet</em>s sur le dossier /bzr (récursivement)</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">addgroup projets              <span style="color: #666666; font-style: italic;"># ajout d'un groupe projets</span>
adduser manu projets        <span style="color: #666666; font-style: italic;"># ajout de l'utilisateur au groupe projets</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>projet1         <span style="color: #666666; font-style: italic;"># création du dossier du premier projet</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>projet2         <span style="color: #666666; font-style: italic;"># création du dossier du deuxième projet</span>
<span style="color: #c20cb9; font-weight: bold;">chgrp</span> <span style="color: #660033;">-R</span> projets <span style="color: #000000; font-weight: bold;">/</span>bzr         <span style="color: #666666; font-style: italic;"># attribution du groupe projet à tous les fichiers du répertoire /bzr</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> g+rw <span style="color: #000000; font-weight: bold;">/</span>bzr          <span style="color: #666666; font-style: italic;"># attribution des droits en lecture/écriture à tous les fichiers pour les membres du groupe projets</span></pre></div></div>

<p>Il n&#8217;est pas nécessaire d&#8217;installer bazaar sur le serveur, mais il est nécessaire que l&#8217;accès par ssh fonctionne, avec ou <a title="Identification ssh sans mot de passe" href="http://astuces.absolacom.com/?p=80" target="_blank">sans mot de passe</a>.</p>
<h2>Sur les clients</h2>
<h3>Mise en place du projet sur le serveur</h3>
<p>Ce sont les clients (qui vont modifier le code des projets) qui doivent installer le logiciel bazaar</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> bzr python-paramiko</pre></div></div>

<p>Les préférences de bazaar (limitées) se trouvent dans <em>Système/Préférences/Bazaar preferences</em></p>
<p>Ce sont eux, aussi, qui vont initier le versionning, à l&#8217;endroit qui leur va bien:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>projets
<span style="color: #c20cb9; font-weight: bold;">mv</span> ~<span style="color: #000000; font-weight: bold;">/</span>Bureau<span style="color: #000000; font-weight: bold;">/</span>monprojet ~<span style="color: #000000; font-weight: bold;">/</span>projets <span style="color: #666666; font-style: italic;"># déplacement des fichiers du prototype dans les projets</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>projets<span style="color: #000000; font-weight: bold;">/</span>monprojet
bzr init                        <span style="color: #666666; font-style: italic;"># initialisation du versionning du projet</span>
bzr add <span style="color: #000000; font-weight: bold;">*</span>                    <span style="color: #666666; font-style: italic;"># ajout de tous les fichiers (récursif) au versionning</span>
bzr commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Création&quot;</span> <span style="color: #666666; font-style: italic;"># prise en compte des modifications avec le commentaire &quot;Création&quot;</span>
bzr push sftp:<span style="color: #000000; font-weight: bold;">//</span>manu<span style="color: #000000; font-weight: bold;">@</span>server<span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>projet1 <span style="color: #660033;">--use-existing-dir</span> <span style="color: #666666; font-style: italic;"># envoi de la version du projet sur le serveur en utilisant les répertoires créés plus haut.</span></pre></div></div>

<h3>Récupération des fichiers sur un autre client</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>beauprojet     <span style="color: #666666; font-style: italic;"># création du dossier qui va accueillir le projet</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>beauprojet
bzr init                     <span style="color: #666666; font-style: italic;"># initialisation du dossier au versionning</span>
bzr merge sftp:<span style="color: #000000; font-weight: bold;">//</span>toto<span style="color: #000000; font-weight: bold;">@</span>server<span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>projet1<span style="color: #000000; font-weight: bold;">/</span>  <span style="color: #666666; font-style: italic;"># intégration des fichiers de &quot;monprojet&quot; dans le dossier &quot;beauprojet&quot; dans lequel on se trouve</span></pre></div></div>

<p>Chacun des clients possède maintenant les fichiers sur lesquels effectuer les développements</p>
<h3>Codage!</h3>
<p>Les clients vont effectuer les modifications sur les documents. Après chaque modification (enfin, chaque fin de bloc de modification) ou avant l&#8217;envoi des fichiers modifiés, il faudra effectuer la commande suivante (qu&#8217;ils aient décidé ou non d&#8217;envoyer les fichiers sur le serveur. Les commit peuvent être fait hors connexion.):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">bzr commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;message&quot;</span></pre></div></div>

<p>qui permet de prendre en compte les modifications effectuées dans le versionning et, accessoirement, de revenir à une version antérieure.</p>
<p>Il suffit ensuite &laquo;&nbsp;d&#8217;assembler&nbsp;&raquo; les fichiers modifiés avec ceux du serveur, que ceux ci aient été modifiés ou non par une autre personne:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">bzr merge sftp:<span style="color: #000000; font-weight: bold;">//</span>toto<span style="color: #000000; font-weight: bold;">@</span>server<span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>projet1<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Enfin, les fichiers &laquo;&nbsp;finaux&nbsp;&raquo; sont envoyés sur le serveur afin d&#8217;être disponibles pour tous les développeurs:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">bzr push sftp:<span style="color: #000000; font-weight: bold;">//</span>toto<span style="color: #000000; font-weight: bold;">@</span>server<span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>projet1<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<h2>A retenir</h2>
<ul>
<li>Il ne suffit pas d&#8217;ajouter un fichier/dossier au répertoire du projet pour qu&#8217;il soit pris en compte. Il faut le faire manuellement avec <strong>bzr add <em>lefichier</em></strong></li>
<li>Pour supprimer un fichier, il faut utiliser <strong>bzr remove <em>lefichier</em></strong></li>
<li>la commande <strong>bzr status</strong> permet de savoir l&#8217;état des fichier (plus exactement, du versionning)</li>
<li>La commande <strong>bzr log</strong> permet de voir le log des changements avec les commentaires</li>
<li>la commande <strong>bzr conflicts</strong> affiche les versions de fichiers en conflits</li>
<li>La commande <strong>bzr resolve</strong> <em><strong>lefichier</strong></em> permet de résoudre les conflits dans le fichier <em>lefichier</em></li>
<li>Le manuel de <strong>bzr</strong> donne plein d&#8217;informations et de commandes utilisables</li>
</ul>
<h2>Interface graphique</h2>
<p>Il existe une interface graphique pour bazaar nommée olive (paquet bzr-gtk) que je n&#8217;ai pas réussi à utiliser: impossible de comprendre les messages d&#8217;erreur (pas parlant) et pas trouvé de configuration à effectuer (ni dans le programme, ni dans les fichiers de configuration).</p>
<p>Pas grave, je suis un adepte de la ligne de commande.</p>
<h3>Autres sources:</h3>
<p><a title="Documentation Bazaar" href="http://bazaar-vcs.org/fr/IntroductionABzr" target="_blank">http://bazaar-vcs.org/fr/IntroductionABzr</a></p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/ubuntu/utilisation-de-bazaar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Identification SSH sans mot de passe</title>
		<link>http://astuces.absolacom.com/non-classe/identification-ssh-sans-mot-de-passe/</link>
		<comments>http://astuces.absolacom.com/non-classe/identification-ssh-sans-mot-de-passe/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 13:28:10 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[developpement]]></category>
		<category><![CDATA[logiciel]]></category>
		<category><![CDATA[Non classé]]></category>
		<category><![CDATA[planet-libre]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[système]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=80</guid>
		<description><![CDATA[Pour utiliser SSH (et dérivés tels que sftp) sans mot de passe, il faut ajouter votre clef sur le serveur. Nous aurons donc un ordinateur (manu-desktop) qui pourra se connecter à un serveur (server) par ssh sans avoir besoin de spécifier de mot de passe. Notez qu&#8217;il existe des outils graphiques pour réaliser ces opérations [...]]]></description>
			<content:encoded><![CDATA[<p>Pour utiliser SSH (et dérivés tels que sftp) sans mot de passe, il faut ajouter votre clef sur le serveur. Nous aurons donc un ordinateur (<em>manu-desktop</em>) qui pourra se connecter à un serveur (<em>server</em>) par ssh sans avoir besoin de spécifier de mot de passe.</p>
<p>Notez qu&#8217;il existe des outils graphiques pour réaliser ces opérations (par exemple seahorse sous Gnome), mais je n&#8217;en parlerais pas.</p>
<h2>Sur l&#8217;ordinateur client (<em>manu-desktop</em>)</h2>
<p>La première chose à faire, si vous n&#8217;avez pas de clef pour votre machine, est d&#8217;en générer une</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">manu<span style="color: #000000; font-weight: bold;">@</span>manu-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span>
Generating public<span style="color: #000000; font-weight: bold;">/</span>private rsa key pair.
Enter <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #c20cb9; font-weight: bold;">which</span> to save the key <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>manu<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Created directory <span style="color: #ff0000;">'/home/manu/.ssh'</span>.
Enter passphrase <span style="color: #7a0874; font-weight: bold;">&#40;</span>empty <span style="color: #000000; font-weight: bold;">for</span> no passphrase<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Enter same passphrase again:
Your identification has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>manu<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.
Your public key has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>manu<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub.
The key fingerprint is:
<span style="color: #7a0874; font-weight: bold;">cd</span>:9e:bb:0a:1e:<span style="color: #000000;">22</span>:<span style="color: #000000;">29</span>:fa:e3:<span style="color: #c20cb9; font-weight: bold;">dc</span>:<span style="color: #000000;">12</span>:<span style="color: #000000;">72</span>:8a:<span style="color: #000000;">15</span>:<span style="color: #000000;">13</span>:<span style="color: #000000;">58</span> manu<span style="color: #000000; font-weight: bold;">@</span>manu-desktop
manu<span style="color: #000000; font-weight: bold;">@</span>manu-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh
total <span style="color: #000000;">8</span>,0K
<span style="color: #000000;">3367418</span> <span style="color: #660033;">-rw-------</span> <span style="color: #000000;">1</span> manu manu <span style="color: #000000;">1</span>,7K <span style="color: #000000;">2009</span>-01-<span style="color: #000000;">15</span> <span style="color: #000000;">13</span>:<span style="color: #000000;">26</span> id_rsa
<span style="color: #000000;">3367419</span> <span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> manu manu  <span style="color: #000000;">399</span> <span style="color: #000000;">2009</span>-01-<span style="color: #000000;">15</span> <span style="color: #000000;">13</span>:<span style="color: #000000;">26</span> id_rsa.pub
manu<span style="color: #000000; font-weight: bold;">@</span>manu-desktop:~$</pre></div></div>

<p>Ne mettez pas de passphrase et laisser les options par défaut pour la création de la clef. Il est aussi possible de spécifier les options via la ligne de commande:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-qt</span> rsa <span style="color: #660033;">-b</span> <span style="color: #000000;">1024</span> <span style="color: #660033;">-C</span> manu <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>manu<span style="color: #000000; font-weight: bold;">@</span>manu-desktop.rsa <span style="color: #660033;">-N</span> <span style="color: #ff0000;">&quot;&quot;</span></pre></div></div>

<p>La commande précédente crée une clef rsa (-t) avec le commentaire (-C) manu d&#8217;une longueur de 1024 bits (-b) dans le fichier ~/.ssh/manu@manu-desktop.rsa (-f) avec une passphrase (-N) vide.</p>
<h2>Sur le serveur (<em>server</em>)</h2>
<p>Le compte utilisateur de connexion doit exister. Il n&#8217;est pas obligé que ce soit le même identifiant que sur le client.  Par exemple, sur le serveur, mon compte est nommé <strong>zephir</strong>.</p>
<pre class="brush: python; title: ; notranslate">
[root@server]:# adduser zephir
Ajout de l'utilisateur « zephir »...
Ajout du nouveau groupe « zephir » (1002)...
Ajout du nouvel utilisateur « zephir » (1002) avec le groupe « zephir »...
Création du répertoire personnel « /home/zephir »...
Copie des fichiers depuis « /etc/skel »...
Entrez le nouveau mot de passe UNIX :
Retapez le nouveau mot de passe UNIX :
passwd : le mot de passe a été mis à jour avec succès
Modification des informations relatives à l'utilisateur zephir
Entrez la nouvelle valeur ou « Entrée » pour conserver la valeur proposée
Nom complet []:
N° de bureau []:
Téléphone professionnel []:
Téléphone personnel []:
Autre []:
Ces informations sont-elles correctes ? [o/N] o
[root@server]:#
</pre>
<h2>Sur l&#8217;ordinateur client (<em>manu-desktop</em>), fin des opérations</h2>
<p>Il ne reste plus au client qu&#8217;à envoyer sa clef d&#8217;identification au serveur simplement par la commande suivante:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ssh-copy-id <span style="color: #660033;">-i</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub zephir<span style="color: #000000; font-weight: bold;">@</span>server</pre></div></div>

<p>Acceptez l&#8217;identification du serveur, le mot de passe est demandé (puisque vous n&#8217;avez pas encore envoyé la clef) et la clef est copiée dans le fichier /home/zephir/.ssh/authorized_keys.<br />
Tentez la commande suivante (Ctrl+D pour sortir)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> zephir<span style="color: #000000; font-weight: bold;">@</span>server</pre></div></div>

<p>Vous ne devriez plus avoir de demande de mot de passe.</p>
<h2>Sur le serveur, fin des opérations</h2>
<p>Il est possible de sécuriser le serveur afin de n&#8217;accepter que les authentifications avec clef et sans demande de mot de passe (pour ssh. L&#8217;accès en local demandera toujours un mot de passe).<br />
Ainsi, les tentatives d&#8217;attaque par force brute sont vouées à l&#8217;échec. MAIS, soyez conscient que vous ne pourrez plus vous connecter depuis une autre machine que celle pour laquelle vous avez envoyé la clef, pas plus que vous ne pourrez envoyer d&#8217;autres clefs.<br />
Paramétrez le fichier /etc/ssh/sshd_config tel que ci dessous:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Authentication:</span>
LoginGraceTime <span style="color: #000000;">120</span>
PermitRootLogin <span style="color: #c20cb9; font-weight: bold;">yes</span>
StrictModes <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
RSAAuthentication <span style="color: #c20cb9; font-weight: bold;">yes</span>
PubkeyAuthentication <span style="color: #c20cb9; font-weight: bold;">yes</span>
AuthorizedKeysFile      <span style="color: #000000; font-weight: bold;">%</span>h<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
&nbsp;
<span style="color: #666666; font-style: italic;"># Change to no to disable tunnelled clear text passwords</span>
PasswordAuthentication no</pre></div></div>

<p>Relancez ensuite le serveur ssh pour prendre en compte les modifications.</p>
<h3>Note sur la sécurité</h3>
<p>L&#8217;accès au serveur est possible sans authentification par l&#8217;utilisateur manu depuis l&#8217;ordinateur client <em>(manu-desktop</em>). Si cet ordinateur est un portable et qu&#8217;il se fait voler, celui qui arrivera à se connecter avec l&#8217;identité de manu arrivera sans demande de mot de passe à se connecter au serveur !<br />
Réfléchissez bien à l&#8217;utilisation de ce mode de fonctionnement avant de le mettre en place.<br />
En cas de vol, il suffira de supprimer le fichier /home/zephir/.ssh/authorized_keys pour que la clef volée avec le portable ne soit plus opérationnelle.<br />
Vous pouvez, de même, recréer et changer vos clefs d&#8217;identification lorsque vous le voulez en réutilisant les commandes données en début d&#8217;article.</p>
<p>Liens:</p>
<p><a title="gnugpg" href="http://doc.ubuntu-fr.org/gnupg" target="_blank">http://doc.ubuntu-fr.org/gnupg</a><br />
<a title="Documentation ssh sur Ubuntu" href="http://doc.ubuntu-fr.org/ssh" target="_blank">http://doc.ubuntu-fr.org/ssh</a></p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/non-classe/identification-ssh-sans-mot-de-passe/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Serveur de synchronisation rsync</title>
		<link>http://astuces.absolacom.com/serveur/serveur-de-synchronisation-rsync/</link>
		<comments>http://astuces.absolacom.com/serveur/serveur-de-synchronisation-rsync/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 11:23:09 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[logiciel]]></category>
		<category><![CDATA[planet-libre]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=60</guid>
		<description><![CDATA[Mettre en place un serveur de synchronisation peut être utile pour éviter les saturations par http ou la mise en place d&#8217;un FTP anonyme. De plus, rsync a l&#8217;avantage de ne transférer que les différences entre les dossiers à synchroniser, ce qui est plus rapide et moins consommateur de ressources. L&#8217;installation du paquet rsync, sur [...]]]></description>
			<content:encoded><![CDATA[<p>Mettre en place un serveur de synchronisation peut être utile pour éviter les saturations par http ou la mise en place d&#8217;un FTP anonyme.<br />
De plus, rsync a l&#8217;avantage de ne transférer que les différences entre les dossiers à synchroniser, ce qui est plus rapide et moins consommateur de ressources.</p>
<p>L&#8217;installation du paquet rsync, sur Ubuntu, ne suffit pas à activer un serveur rsync; il reste quelques manipulations simples à mettre en place.</p>
<p>Tout d&#8217;abord, si le progrmme rsync n&#8217;est pas installé, faites le:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> rsync</pre></div></div>

<p>Le serveur <em>rsyncd</em> a besoin d&#8217;un fichier de configuration <em>/etc/rsyncd.conf</em>. Voici un exemple de fichier:</p>
<pre class="brush: python; title: ; notranslate">
# sample rsyncd.conf configuration file

# GLOBAL OPTIONS

#motd file=/etc/motd
#log file=/var/log/rsyncd
# for pid file, do not use /var/run/rsync.pid if
# you are going to run rsync out of the init.d script.
pid file=/var/run/rsyncd.pid
#syslog facility=daemon
#socket options=
read only = yes
list = yes
uid = nobody
gid = nogroup
use chroot = yes
max connections=10
log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
syslog facility=local5

# MODULE OPTIONS
[astuces]
	comment = repertoire des astuces
	path = /var/www/astuces
#	use chroot = yes
#	max connections=10
	lock file = /var/lock/rsyncd
# the default for read only is yes...
	#read only = yes
	#list = yes
	#uid = nobody
	#gid = nogroup
#	exclude =
#	exclude from =
#	include =
#	include from =
#	auth users =
#	secrets file = /etc/rsyncd.secrets
	strict modes = yes
#	hosts allow =
#	hosts deny =
	ignore errors = no
	ignore nonreadable = yes
	transfer logging = no
#	log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
	timeout = 600
	refuse options = checksum dry-run
	dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
</pre>
<p>Pour la définition des options, consulter le man.<br />
Les options peuvent être placées dans une section (auquel cas elles ne s&#8217;appliquent qu&#8217;à cette section, ou en tête de fichier (hors section) et s&#8217;appliquent alors à toutes les sections, sauf configuration contraire dans l&#8217;une d&#8217;elle.</p>
<p>Le serveur peut désormais être lancé manuellement ainsi:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> rsync <span style="color: #660033;">--daemon</span></pre></div></div>

<p>Mais il est plus simple d&#8217;activer le lancement en démon au démarrage en modifiant le fichier <em>/etc/default/rsync. </em>Voici un fichier correctement paramétré:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># defaults file for rsync daemon mode</span>
<span style="color: #666666; font-style: italic;"># start rsync in daemon mode from init.d script?</span>
<span style="color: #666666; font-style: italic;">#  only allowed values are &quot;true&quot;, &quot;false&quot;, and &quot;inetd&quot;</span>
<span style="color: #666666; font-style: italic;">#  Use &quot;inetd&quot; if you want to start the rsyncd from inetd,</span>
<span style="color: #666666; font-style: italic;">#  all this does is prevent the init.d script from printing a message</span>
<span style="color: #666666; font-style: italic;">#  about not starting rsyncd (you still need to modify inetd's config yourself).</span>
<span style="color: #007800;">RSYNC_ENABLE</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #666666; font-style: italic;"># which file should be used as the configuration file for rsync.</span>
<span style="color: #666666; font-style: italic;"># This file is used instead of the default /etc/rsyncd.conf</span>
<span style="color: #666666; font-style: italic;"># Warning: This option has no effect if the daemon is accessed</span>
<span style="color: #666666; font-style: italic;">#          using a remote shell. When using a different file for</span>
<span style="color: #666666; font-style: italic;">#          rsync you might want to symlink /etc/rsyncd.conf to</span>
<span style="color: #666666; font-style: italic;">#          that file.</span>
<span style="color: #666666; font-style: italic;"># RSYNC_CONFIG_FILE=</span>
<span style="color: #666666; font-style: italic;"># what extra options to give rsync --daemon?</span>
<span style="color: #666666; font-style: italic;">#  that excludes the --daemon; that's always done in the init.d script</span>
<span style="color: #666666; font-style: italic;">#  Possibilities are:</span>
<span style="color: #666666; font-style: italic;">#   --address=123.45.67.89        (bind to a specific IP address)</span>
<span style="color: #666666; font-style: italic;">#   --port=8730                (bind to specified port; default 873)</span>
<span style="color: #007800;">RSYNC_OPTS</span>=<span style="color: #ff0000;">''</span>
<span style="color: #666666; font-style: italic;"># run rsyncd at a nice level?</span>
<span style="color: #666666; font-style: italic;">#  the rsync daemon can impact performance due to much I/O and CPU usage,</span>
<span style="color: #666666; font-style: italic;">#  so you may want to run it at a nicer priority than the default priority.</span>
<span style="color: #666666; font-style: italic;">#  Allowed values are 0 - 19 inclusive; 10 is a reasonable value.</span>
<span style="color: #007800;">RSYNC_NICE</span>=<span style="color: #ff0000;">'10'</span>
<span style="color: #666666; font-style: italic;"># Don't forget to create an appropriate config file,</span>
<span style="color: #666666; font-style: italic;"># else the daemon will not start.</span></pre></div></div>

<p>Une fois ceci fait, il ne reste plus qu&#8217;à relancer rsync:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">killall</span> rsync
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>rsync restart</pre></div></div>

<p>Désormais les utilisateurs peuvent synchroniser anonymement le répertoire que vous avez programmé par la commande:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rsync <span style="color: #660033;">-avP</span> www.montsite.org::astuces <span style="color: #000000; font-weight: bold;">/</span>mon<span style="color: #000000; font-weight: bold;">/</span>dossier<span style="color: #000000; font-weight: bold;">/</span>a<span style="color: #000000; font-weight: bold;">/</span>synchroniser<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Notez que dans la commande ci dessus, <em>astuces</em> est appelé <strong>module</strong> par rsync. Ce module correspond à la section entre crochets que vous avez défini dans le fichier de configuration ([astuces])</p>
<p><span style="text-decoration: underline;"><strong>Autres sources d&#8217;information:</strong></span></p>
<p><a title="Documentation rsyncd sur ubuntu-fr" href="http://doc.ubuntu-fr.org/rsync" target="_blank">http://doc.ubuntu-fr.org/rsync</a><br />
<a title="Rsync avec identification par mot de passe" href="http://prendreuncafe.com/blog/post/2007/01/18/Synchro-distante-automatique-via-un-daemon-rsync-sur-Ubuntu">http://prendreuncafe.com/blog/?q=rsyncd</a><br />
<a title="Man de rsyncd sur developpez.com" href="http://man.developpez.com/man5/rsyncd.conf.5.php">http://man.developpez.com/man5/rsyncd.conf.5.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/serveur/serveur-de-synchronisation-rsync/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Faire fonctionner le micro avec skype sur l&#8217;Aspire One et Ubuntu 8.10</title>
		<link>http://astuces.absolacom.com/non-classe/faire-fonctionner-le-micro-avec-skype-sur-laspire-one-et-ubuntu-810/</link>
		<comments>http://astuces.absolacom.com/non-classe/faire-fonctionner-le-micro-avec-skype-sur-laspire-one-et-ubuntu-810/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 13:14:04 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[acer aspire one]]></category>
		<category><![CDATA[logiciel]]></category>
		<category><![CDATA[Non classé]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[acer]]></category>
		<category><![CDATA[aspire]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=32</guid>
		<description><![CDATA[Après installation de Ubuntu sur l&#8217;Acer aspire One (ou AAO), le microphone ne fonctionne pas avec skype. Je vous livre les manipulations qui m&#8217;ont permis de le faire fonctionner: Ouvrir le contôleur de volume (clic droit sur l&#8217;icone du haut parleur sur la barre des tâches et &#171;&#160;ouvrir le contrôleur de volume&#160;&#187;) Régler les options [...]]]></description>
			<content:encoded><![CDATA[<p>Après installation de Ubuntu sur l&#8217;Acer aspire One (ou AAO), le microphone ne fonctionne pas avec skype.</p>
<p>Je vous livre les manipulations qui m&#8217;ont permis de le faire fonctionner:</p>
<ul>
<li> Ouvrir le contôleur de volume (clic droit sur l&#8217;icone du haut parleur sur la barre des tâches et &laquo;&nbsp;ouvrir le contrôleur de volume&nbsp;&raquo;)</li>
<li>Régler les options comme sur les captures ci dessous. Notez le périphérique contrôlé (HDA Intel)</li>
</ul>
<div id="attachment_36" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-36" title="lecture" src="http://astuces.absolacom.com/wp-content/uploads/2009/01/lecture-300x237.png" alt="Réglage de l'onglet lecture" width="300" height="237" /><p class="wp-caption-text">Réglage de l&#39;onglet lecture</p></div>
<div id="attachment_35" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-35" title="enregistrement" src="http://astuces.absolacom.com/wp-content/uploads/2009/01/enregistrement-300x232.png" alt="Réglages de l'onglet enregistrement" width="300" height="232" /><p class="wp-caption-text">Réglages de l&#39;onglet enregistrement</p></div>
<div id="attachment_37" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-37" title="options" src="http://astuces.absolacom.com/wp-content/uploads/2009/01/options-300x234.png" alt="Réglages de l'onglet options" width="300" height="234" /><p class="wp-caption-text">Réglages de l&#39;onglet options</p></div>
<ul>
<li>Lancer skype et ouvrir le réglage des préférences</li>
<li>Ouvrir l&#8217;onglet son et régler comme sur la capture
<p><div id="attachment_38" class="wp-caption alignnone" style="width: 160px"><img class="size-thumbnail wp-image-38" title="skype_options" src="http://astuces.absolacom.com/wp-content/uploads/2009/01/skype_options-150x150.png" alt="Options audio de skype" width="150" height="150" /><p class="wp-caption-text">Options audio de skype</p></div></li>
<li>Cliquez sur &laquo;&nbsp;Appliquer&nbsp;&raquo; et vous pouvez lancer un appel et profiter des communications par le réseau</li>
</ul>
<p>A noter que j&#8217;utilise le noyau de FOZZY optimisé pour le AAO (<a title="Forum aspire one" href="http://aspireoneuser.com/forum/viewtopic.php?f=28&amp;t=7560&amp;start=100#p53697">http://aspireoneuser.com/forum/viewtopic.php?f=28&amp;t=7560&amp;start=0</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/non-classe/faire-fonctionner-le-micro-avec-skype-sur-laspire-one-et-ubuntu-810/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Augmenter les résolutions disponibles</title>
		<link>http://astuces.absolacom.com/ubuntu/augmenter-les-resolutions-disponibles/</link>
		<comments>http://astuces.absolacom.com/ubuntu/augmenter-les-resolutions-disponibles/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 21:18:27 +0000</pubDate>
		<dc:creator>manuberro</dc:creator>
				<category><![CDATA[Matériel]]></category>
		<category><![CDATA[planet-libre]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[système]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[résolution]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://astuces.absolacom.com/?p=19</guid>
		<description><![CDATA[pour m&#8217;éviter de chercher et l&#8217;avoir une fois pour toutes noté quelque part: Section "Monitor" Identifier      "Configured Monitor" HorizSync       30.0 - 83.0 VertRefresh     55.0 - 75.0 EndSection et Section &#34;Screen&#34; Identifier      &#34;Default Screen&#34; Monitor         &#34;Configured Monitor&#34; Device          &#34;Configured Video Device&#34; DefaultDepth    24 SubSection &#34;Display&#34; Depth        24 Modes        &#34;1024x768&#34; &#34;960x600&#34; &#34;800x600&#34; EndSubSection Ceci permet d&#8217;indiquer au [...]]]></description>
			<content:encoded><![CDATA[<p>pour m&#8217;éviter de chercher et l&#8217;avoir une fois pour toutes noté quelque part:</p>
<pre lang="bash&quot;">Section "Monitor"
Identifier      "Configured Monitor"
HorizSync       30.0 - 83.0
VertRefresh     55.0 - 75.0

EndSection</pre>
<p>et</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Section <span style="color: #ff0000;">&quot;Screen&quot;</span>
Identifier      <span style="color: #ff0000;">&quot;Default Screen&quot;</span>
Monitor         <span style="color: #ff0000;">&quot;Configured Monitor&quot;</span>
Device          <span style="color: #ff0000;">&quot;Configured Video Device&quot;</span>
DefaultDepth    <span style="color: #000000;">24</span>
SubSection <span style="color: #ff0000;">&quot;Display&quot;</span>
Depth        <span style="color: #000000;">24</span>
Modes        <span style="color: #ff0000;">&quot;1024x768&quot;</span> <span style="color: #ff0000;">&quot;960x600&quot;</span> <span style="color: #ff0000;">&quot;800x600&quot;</span>
EndSubSection</pre></div></div>

<p>Ceci permet d&#8217;indiquer au serveur X qu&#8217;il peut sortir du mode sécurisé des dimensions 640&#215;480 et 800&#215;600 pour monter en fréquence vers des dimensions supérieures.</p>
]]></content:encoded>
			<wfw:commentRss>http://astuces.absolacom.com/ubuntu/augmenter-les-resolutions-disponibles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

