Derniers articles http://www.tekniko.fr Derniers articles (C) 2005-2009 PHPBoost fr PHPBoost Serveur ftp avec vsftpd : Sécurité. (2) http://www.tekniko.fr/cms/articles/articles-2-49+serveur-ftp-avec-vsftpd-securite-2.php http://www.tekniko.fr/cms/articles/articles-2-49+serveur-ftp-avec-vsftpd-securite-2.php Nous venons de voir comment mettre en oeuvre de façon sécurisé un serveur ftp avec <a href="http://www.tekniko.fr/cms/articles/articles-2-48+serveur-ftp-avec-vsftpd-2-securite-1.php">vsftpd/pam/xinetd</a>, nous allons voir maintenant, afin de nous sécuriser un peu plus, comment crypter ces échanges ftp avec <a href="http://fr.wikipedia.org/wiki/OpenSSL">OpenSSL</a>.<br /> <br /> <em>OpenSSL</em> c'est quoi ? Et bien c'est une boite à outils comme dit sur le <em>Wikipédia</em>, des bibliothèques ainsi que des commandes en ligne, et avec ces outils, nous allons pouvoir crypter nos échanges, c'est le même principe que lorsque vous achetez un produit quelconque sur le web, généralement, au moment de banquer vous devez signer un certificat de sécurité un peu obscur, puis vous passez en mode "sécurisé" (<em><a href="http://fr.wikipedia.org/wiki/Https#HTTPS">https</a></em>), a partir de la, les données qui transitent entre vous et le "site" (numéro de carte bancaire, coordonnées etc...) sont cryptées. C'est le résultat d'<em>Openssl</em> couplé au serveur <em>Apache</em>, nous, nous allons le coupler à <em>Vsftpd</em>, le principe restera le même mise à part que ce sera le protocole <em>ftp</em> qui sera crypté (ftps)et non <em><a href="http://fr.wikipedia.org/wiki/Http">http</a></em>. <br /> <br /> Ah oui, cette histoire de certificat...En quoi cela ajoute t'il une sécurité ?? Normalement, on se créer un certificat avec nos coordonnées, mail, le domaine du site..., puis on le soumet à un <a href="http://www.verisign.fr/index.html">organisme de vérification</a> qui certifiera de notre identité en signant notre certif, comme ça, le client qui va voir notre beau certificat constatera que machin l'a vérifié et il pourra donc le signer et ainsi avoir une confiance aveugle, ou presque. <br /> <br /> c'est super mais ça coute beaucoup de sous de faire signer son certificat par les gens qui vont bien... Alors comme c'est la crise, on va s'auto-certifier nos certificat, on va les signer nous même ! <br /> <br /> <span class="success"><strong>Commençons !</strong></span><br /> <br /> Nous repartons sur la configuration du <a href="http://www.tekniko.fr/cms/articles/articles-2-48+serveur-ftp-avec-vsftpd-2-securite-1.php">premier article</a>, donc notre serveur ftp est déjà fonctionnel, il ne reste plus qu'à installer <em>OpenSSL</em>, générer les certificats, avertir <em>vsftpd</em> du changement et enfin, configurer le client ftp pour qu'il soit sur le protocole <em>ftps</em> pour pouvoir se connecter.<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><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> openssl</pre></pre></div><br /> Sera nécessaire mais il est très probable qu'il soit déjà installé. Le fait qu'il soit installé ne veut pas dire qu'il ne reste qu'a ajouter deux ou trois choses. On va commencer par créer un répertoire qui contiendra deux sous répertoires, un pour la base de données des certificats que nous signerons (privé), un autre pour les demande et ceux que l'on générera (newcerts).<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>CA <span style="color: #666666; font-style: italic;"># CA pour Certificat d'Autorité.</span> <span style="color: #7a0874; font-weight: bold;">cd</span> CA <span style="color: #c20cb9; font-weight: bold;">mkdir</span> privé newcerts</pre></pre></div><br /> Jusque là rien de transcendant, créons la base de données qui accueillera les futurs certificats que nous signerons : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'01'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> serial <span style="color: #c20cb9; font-weight: bold;">touch</span> index.txt</pre></pre></div><br /> Maintenant, nous allons créer un fichier de configuration spécifique que nous agrémenterons au fur et à mesure du courant. Pour le moment, on y met que ça :<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>CA<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf &nbsp; <span style="color: #666666; font-style: italic;"># OpenSSL configuration file. </span> <span style="color: #666666; font-style: italic;"># </span> &nbsp; <span style="color: #666666; font-style: italic;"># Establish working directory. </span> <span style="color: #c20cb9; font-weight: bold;">dir</span> = . &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>Req<span style="color: #7a0874; font-weight: bold;">&#93;</span> default_bits = <span style="color: #000000;">1024</span> <span style="color: #666666; font-style: italic;"># Taille des touches </span> key.pem default_keyfile = <span style="color: #666666; font-style: italic;"># nom de clés générées </span> default_md = md5 message <span style="color: #666666; font-style: italic;"># algorithme de </span> string_mask = <span style="color: #666666; font-style: italic;"># nombstr permis caractères </span> distinguished_name = req_distinguished_name &nbsp; <span style="color: #7a0874; font-weight: bold;">&#93;</span> Req_distinguished_name <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #666666; font-style: italic;"># Nom de la variable de chaîne rapide </span> <span style="color: #666666; font-style: italic;">#---------------------- --------------------------- ------- </span> 0.organizationName = Nom organisation <span style="color: #7a0874; font-weight: bold;">&#40;</span>entreprise<span style="color: #7a0874; font-weight: bold;">&#41;</span> organizationalUnitName = Unité organisation Nom <span style="color: #7a0874; font-weight: bold;">&#40;</span>département, division<span style="color: #7a0874; font-weight: bold;">&#41;</span> emailAddress = Adresse Email emailAddress_max = <span style="color: #000000;">40</span> Nom Localité localityName = <span style="color: #7a0874; font-weight: bold;">&#40;</span>ville, district<span style="color: #7a0874; font-weight: bold;">&#41;</span> stateOrProvinceName = nom état ou la province <span style="color: #7a0874; font-weight: bold;">&#40;</span>nom complet<span style="color: #7a0874; font-weight: bold;">&#41;</span> Nom Pays countryName = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2</span> letter code<span style="color: #7a0874; font-weight: bold;">&#41;</span> countryName_min = <span style="color: #000000;">2</span> countryName_max = <span style="color: #000000;">2</span> commonName = Nom commun <span style="color: #7a0874; font-weight: bold;">&#40;</span>nom hôte, IP, ou votre nom<span style="color: #7a0874; font-weight: bold;">&#41;</span> commonName_max = <span style="color: #000000;">64</span> &nbsp; <span style="color: #666666; font-style: italic;"># Les valeurs par défaut pour ce qui précède, par souci de cohérence et moins de frappe. </span> <span style="color: #666666; font-style: italic;"># Nom de la variable Valeur </span> <span style="color: #666666; font-style: italic;">#------------------------------ ------------------- ----------- </span> 0.organizationName_default = La Société échantillon localityName_default = Metropolis stateOrProvinceName_default = New York countryName_default = US &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>V3_ca<span style="color: #7a0874; font-weight: bold;">&#93;</span> basicConstraints = CA: TRUE subjectKeyIdentifier = <span style="color: #7a0874; font-weight: bold;">hash</span> authorityKeyIdentifier = keyid: toujours, l<span style="color: #ff0000;">'émetteur: toujours </span></pre></pre></div><br /> Voila tout ce qu'il faut préciser pour commencer, ce fichier est modulaire, différentes sections peuvent le composer, et certaine section peuvent avoir besoin d'autres sections... Chaque section commence par un nom entre crochets, ici cest : REQ.<br /> Dans ce fichier, il n'a que la section concernant les coordonnées propre a la demande d'un certificat qui soit là mais nous pouvons des maintenant créer notre certificat racine et se l'auto-signer avec cette commande : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-extensions</span> v3_ca <span style="color: #660033;">-keyout</span> private<span style="color: #000000; font-weight: bold;">/</span>cakey.pem <span style="color: #660033;">-out</span> cacert.pem <span style="color: #660033;">-days</span> <span style="color: #000000;">650</span> <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf</pre></pre></div><br /> Je vous invite a lire la <em><a href="http://www.delafond.org/traducmanfr/man/man1/openssl.1.html">page de man d'OpenSSL</a></em> pour plus d'infos, ici, on passe une requête pour avoir un nouveau certificat <span style="text-decoration: underline;">signable</span>, il devrait placer la certificat d'autorité dans le répertoire courant (<em>/etc/CA</em> si on est déjà dedans), celui ci sera valable 650 jours, et la clé privée qui va avec dans <em>private</em>, et il devra faire tout ça en fonction de la configuration présente dans son fichier de conf.<br /> <br /> Dors et déjà, avec notre nouveau certificat d'autorité racine (<em>cacert.pem</em>), nous pouvons créer n'importe quel nombre de "sous" certificats pour différentes applications (https, fpts, simap...). Il faut maintenant créer l'invitation à signer notre certificat, on va rajouter des paramètres au fichier de conf :<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"> req_extensions = v3_req</pre></pre></div><br /> A placer en dessous de la ligne <br /> distinguished_name = req_distinguished_name<br /> Ensuite, à la fin du fichier rajouter ceci : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"> <span style="color: #7a0874; font-weight: bold;">&#91;</span>V3_req<span style="color: #7a0874; font-weight: bold;">&#93;</span> basicConstraints = CA: FALSE subjectKeyIdentifier = <span style="color: #7a0874; font-weight: bold;">hash</span></pre></pre></div><br /> créons cet invitation : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-out</span> req.pem <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf</pre></pre></div><br /> Ce processus crée deux fichiers, une clé privé key.pem et l'invitation à signer qui va avec req.pem, qu'il serait préférable de renommer si on utilise SSL sur plusieurs services.<br /> <br /> On a notre certificat d'autorité racine, on a notre invitation a signer, certifions nous en nous signant alors ! Une derniere fois, on édite le fichier de conf pour lui rajouter les choses qui vont bien, a savoir la ou il trouvera la base de données, ou est la clé privée... Ajoutons ces quelques ligne avant la section req : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span> ca <span style="color: #7a0874; font-weight: bold;">&#93;</span> default_ca = CA_default &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span> CA_default <span style="color: #7a0874; font-weight: bold;">&#93;</span> serial = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>serial database = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>index.txt new_certs_dir = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>newcerts certificate = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>cacert.pem private_key = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>cakey.pem default_days = <span style="color: #000000;">365</span> default_md = md5 preserve = no email_in_dn = no nameopt = default_ca certopt = default_ca policy = policy_match &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span> policy_match <span style="color: #7a0874; font-weight: bold;">&#93;</span> countryName = match stateOrProvinceName = match organizationName = match organizationalUnitName = optional commonName = supplied emailAddress = optional </pre></pre></div><br /> Maintenant signons le !!!<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">openssl ca <span style="color: #660033;">-out</span> cert.pem <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf <span style="color: #660033;">-infiles</span> req.pem</pre></pre></div> <br /> Nous venons de créer deux nouveau fichiers, notre certificat signé (enfin) et une copie de celui ci dans <em>newcerts.</em> Ce certificat comporte deux version, une codée, une humainement compréhensible, enlevons cette dernière pour plus de sécurité : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> cert.pem tmp.pem openssl x509 <span style="color: #660033;">-in</span> tmp.pem <span style="color: #660033;">-out</span> cert.pem </pre></pre></div><br /> L'installation du certificat et de sa clé dépend de l'application de destination, pour <em>vsftpd</em>, on va fusionner ces deux derniers :<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> key.pem cert.pem <span style="color: #000000; font-weight: bold;">&gt;</span>key-cert.pem </pre></pre></div><br /> Pour finir, expliquons à <em>vsftpd</em> qu'il doit gérer le <em>SSL</em> et que les logins/passwords ainsi que tout le transite ftp, devront être cryptés, et ou se trouve le certificat et la clé <em>SSL</em>.<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd.conf &nbsp; <span style="color: #007800;">listen</span>=NO <span style="color: #007800;">anonymous_enable</span>=NO <span style="color: #007800;">local_enable</span>=YES <span style="color: #007800;">virtual_use_local_privs</span>=YES <span style="color: #007800;">write_enable</span>=YES <span style="color: #007800;">connect_from_port_20</span>=YES <span style="color: #007800;">pam_service_name</span>=vsftpd <span style="color: #007800;">guest_enable</span>=YES <span style="color: #007800;">guest_username</span>=www-data <span style="color: #007800;">user_sub_token</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span> <span style="color: #007800;">local_root</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span> <span style="color: #007800;">chroot_local_user</span>=YES <span style="color: #007800;">hide_ids</span>=YES <span style="color: #007800;">xferlog_enable</span>=YES <span style="color: #007800;">user_config_dir</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd<span style="color: #000000; font-weight: bold;">/</span>vsftpd_user_conf &nbsp; <span style="color: #666666; font-style: italic;"># Pour le SSL</span> <span style="color: #007800;">ssl_enable</span>=YES <span style="color: #007800;">allow_anon_ssl</span>=NO <span style="color: #007800;">force_local_data_ssl</span>=NO <span style="color: #007800;">force_local_logins_ssl</span>=YES &nbsp; <span style="color: #007800;">ssl_tlsv1</span>=YES <span style="color: #007800;">ssl_sslv2</span>=YES <span style="color: #007800;">ssl_sslv3</span>=YES <span style="color: #007800;">rsa_cert_file</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>CA<span style="color: #000000; font-weight: bold;">/</span>key-cert.pem</pre></pre></div><br /> <br /> Voili voilou, on relance vsftpd et l'affaire et dans le sac. A noter que tout les clients <em>ftp</em> ne gère pas forcément le <em>ftps</em> ou <em>ftpes</em> Pour moi cela a fonctionné avec FileZilla en mode ftpes<br /> <!-- START HTML --> <div id="media"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="450" height="350" id="csSWF"> <param name="movie" value="http://www.tekniko.fr/cms/articles/ssl_controller.swf" /> <param name="quality" value="best" /> <param name="bgcolor" value="#1a1a1a" /> <param name="allowfullscreen" value="true" /> <param name="scale" value="showall" /> <param name="allowscriptaccess" value="always" /> <param name="flashvars" value="autostart=false&thumb=FirstFrame.png&thumbscale=45&color=0x000000,0x000000" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="http://www.tekniko.fr/cms/articles/ssl_controller.swf" width="450" height="350"> <param name="quality" value="best" /> <param name="bgcolor" value="#1a1a1a" /> <param name="allowfullscreen" value="true" /> <param name="scale" value="showall" /> <param name="allowscriptaccess" value="always" /> <param name="flashvars" value="autostart=false&thumb=FirstFrame.png&thumbscale=45&color=0x000000,0x000000" /> <!--<![endif]--> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </div> <!-- END HTML --> Fri, 18 Jun 2010 04:10:51 +0200 Serveur ftp avec vsftpd : Sécurité. (1) http://www.tekniko.fr/cms/articles/articles-2-48+serveur-ftp-avec-vsftpd-securite-1.php http://www.tekniko.fr/cms/articles/articles-2-48+serveur-ftp-avec-vsftpd-securite-1.php ici nous allons voir brièvement comment, avec <em><a href="http://vsftpd.beasts.org/">VSFTP</a></em>, on peut se créer un "système d'hébergement", un peu comme ce que pourrait nous offrir un hébergeur comme <strong><em><a href="http://www.phpnux.com/">PHPNux</a></em></strong>, mais l'on pourrait très bien y trouver quelques utilisations internes en entreprise.<br /> <br /> Il s'agit là de monter un <a href="http://fr.wikipedia.org/wiki/Serveur_Web">serveur web</a> pour consulter des documents, et <a href="http://fr.wikipedia.org/wiki/Serveur_FTP">ftp</a> pour les manipuler. Comme ce n'est pas encore la foire au <a href="http://desencyclopedie.wikia.com/wiki/Dindon">dindons</a>, il ne faut pas que n'importe qui puisse faire n'importe quoi donc nous allons faire appel à un système d'<strong><a href="http://fr.wikipedia.org/wiki/Authentification">authentification</a></strong> pour sécuriser un peu tout cela.<br /> <br /> Bon, l'idée est lancée, il faut la mettre en oeuvre, partons sur une Debian Lenny comme système, celle du <a href="http://www.tekniko.fr/cms/articles/articles-2-45+le-raid-facile-sous-linux.php">Raid 1</a> par exemple, pour mémoire et pour celles et ceux qui n'auraient pas lu <a href="http://www.tekniko.fr/cms/articles/articles-2-45+le-raid-facile-sous-linux.php">l'article en question</a>, il s'agit d'un serveur équipé d'un système Debian Lenny, monté sur un <em>RAID 1</em> grâce à <em>mdma</em>, le tout dans VirtualBox, cette <em>VM</em> est vue comme une machine physique sur mon réseau local. Nous choisirons <a href="http://www.apache.org/">Apache</a> et consorts pour assurer la partie web, bien sur Vsftpd pour la partie ftp et <a href="http://fr.wikipedia.org/wiki/Pluggable_Authentication_Modules">Pam</a> pour s'occuper de l'authentification.<br /> <br /> <span class="success"><strong>Commençons !</strong></span><br /> <br /> On peut installer l'ensemble des composants en même temps, cependant, limitons nous à la partie web pour le moment, et installonsle serveur Apache 2 ainsi que quelques outils qui pourraient être nécessaires : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><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> apache2 mysql-server php5 php5 mysql phpmyadmin</pre></pre></div><br /> Nous venons d'installer le serveur web, un <a href="http://fr.wikipedia.org/wiki/MySQL">serveur de bases de données</a> ainsi qu'un langage web très répandu en deux secondes !<br /> <br /> Il y a très peu de configuration a faire pour obtenir une page accessible depuis le réseau, cela se situe principalement au niveau du serveur Apache qu'il faut regarder un peu, c'est très facile de voir son fichier de configuration sans les commentaires et c'est bien plus rapide d'y voir quelque chose !<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><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>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">'#'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">less</span></pre></pre></div><br /> Cela nous à donné un aperçu de ce qu'il y a dans ce fichier : <br /> <span class="text_hide">Caché:</span><div class="hide" onclick="bb_hide(this)"><div class="hide2"><br /> <br /> ServerRoot "/etc/apache2"<br /> <br /> LockFile /var/lock/apache2/accept.lock<br /> <br /> PidFile ${APACHE_PID_FILE}<br /> <br /> Timeout 300<br /> <br /> KeepAlive On<br /> <br /> MaxKeepAliveRequests 100<br /> <br /> KeepAliveTimeout 15<br /> <br /> <br /> &lt;IfModule mpm_prefork_module&gt;<br /> StartServers 5<br /> MinSpareServers 5<br /> MaxSpareServers 10<br /> MaxClients 150<br /> MaxRequestsPerChild 0<br /> &lt;/IfModule&gt;<br /> <br /> &lt;IfModule mpm_worker_module&gt;<br /> StartServers 2<br /> MinSpareThreads 25<br /> MaxSpareThreads 75 <br /> ThreadLimit 64<br /> ThreadsPerChild 25<br /> MaxClients 150<br /> MaxRequestsPerChild 0<br /> &lt;/IfModule&gt;<br /> <br /> &lt;IfModule mpm_event_module&gt;<br /> StartServers 2<br /> MaxClients 150<br /> MinSpareThreads 25<br /> MaxSpareThreads 75 <br /> ThreadLimit 64<br /> ThreadsPerChild 25<br /> MaxRequestsPerChild 0<br /> &lt;/IfModule&gt;<br /> <br /> User ${APACHE_RUN_USER}<br /> Group ${APACHE_RUN_GROUP}<br /> <br /> <br /> AccessFileName .htaccess<br /> <br /> &lt;Files ~ "^\.ht"&gt;<br /> Order allow,deny<br /> Deny from all<br /> Satisfy all<br /> &lt;/Files&gt;<br /> <br /> DefaultType text/plain<br /> <br /> <br /> HostnameLookups Off<br /> <br /> ErrorLog /var/log/apache2/error.log<br /> <br /> LogLevel warn<br /> <br /> Include /etc/apache2/mods-enabled/*.load<br /> Include /etc/apache2/mods-enabled/*.conf<br /> <br /> Include /etc/apache2/httpd.conf<br /> <br /> Include /etc/apache2/ports.conf<br /> <br /> LogFormat "%v:%p %h %l %u %t \"%r\" %&gt;s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined<br /> LogFormat "%h %l %u %t \"%r\" %&gt;s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined<br /> LogFormat "%h %l %u %t \"%r\" %&gt;s %O" common<br /> LogFormat "%{Referer}i -&gt; %U" referer<br /> LogFormat "%{User-agent}i" agent<br /> <br /> CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined<br /> <br /> <br /> <br /> Include /etc/apache2/conf.d/<br /> <br /> Include /etc/apache2/sites-enabled/<br /> </div></div><br /> il faut l'éditer maintenant pour modifier quelques paramétres en prenant soin d'en garder une copie de sauvegarde avant.<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf-origine <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf</pre></pre></div><br /> Juste au dessus de la directive ServerRoot, rajouter la suivante : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">ServerName 192.168.1.141:<span style="color: #000000;">80</span></pre></pre></div><br /> Cette directive indique à apache sur quelle adresse et port il doit s'identifier lui même. 192.167.1.141 est l'adresse de la machine virtuelle, 80 le port d'écoute par défaut.<br /> Après ça, on va faire en sorte qu'Apache n'envoie pas trop de détail sur qui il est ! Cela se passe dans le fichier security. Dans ce fichier, on peut définir la quantité d'infos qu'Apache envoie à son sujet (système sur lequel il tourne par exemple).<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>security</pre></pre></div><br /> Ici, on va d'abord se rendre à la ligne ou se situe la directive <em>ServerTokens</em>, on peut attribuer plusieurs niveaux à celle ci : <br /> <ul class="bb_ul"> <li class="bb_li">Full </li><li class="bb_li">OS </li><li class="bb_li">Minimal </li><li class="bb_li">Minor </li><li class="bb_li">Major </li><li class="bb_li">Prod<br /> </li></ul><br /> Chacunes désignent un niveau d'info envoyées, ici je choisis <em>Prod</em>, pour ne rien envoyer, j'ajoute : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">ServerTokens Prod</pre></pre></div><br /> Ensuite, pour ne pas envoyer le nom du serveur en lui même, juste en dessous, passons la directive <em>serverSignature</em> sur off<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">ServerSignature Off</pre></pre></div><br /> On reload la configuration dans le serveur pour prendre en compte immédiatement ces changements : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><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>apache2 reload</pre></pre></div><br /> <span class="success"><strong>Voila pour la partie web ! </strong></span><br /> Notre serveur est correctement configuré et prêt à accueillir de simples fichiers html statiques à afficher ou une structure de site dynamique grâce au serveur de bases de données et à <a href="http://www.phpmyadmin.net/">PHPMyadmin</a> pour administrer celles ci.<br /> <br /> On peut maintenant s'occuper de la partie ftp/authentification, qui sera le "gros morceau" du <em>howto</em> puisque nous allons être beaucoup plus exigeant que dans un <a href="http://www.tekniko.fr/cms/articles/articles-2-5+serveur-ftp-avec-vsftpd-1-mise-en-place.php">précédent article</a> ou j'expliquais la mise en place de <em>VSFTPD</em> dans une conf basique; Ici, l'utilisateur anonyme sera bannit !<br /> <br /> Nous allons installer le serveur ftp de façon à ce que seule une personne identifiée puisse s'y connecter, mais aussi de façon à ce que le serveur ne soit pas constamment en écoute, mais se réveille seulement lors d'un appel. Nous ferons aussi en sorte que le dossier de l'utilisateur soit la racine du (ou des si plusieurs users) site(s) web.<br /> <br /> Tout cela est possible grâce au trio <em>Vsftpd/pam/<a href="http://fr.wikipedia.org/wiki/Xinetd">xinetd</a></em>. Vsftpd pour le serveur ftp donc, Pam, qui signifie <em><a href="http://fr.wikipedia.org/wiki/Pluggable_Authentication_Modules">Pluggable Authentication Modules</a></em> offre un système d'authentification simple et très sécurisé, grâce à lui, nos utilisateurs seront listés dans un fichier bien spécifique accompagné de leurs mots de passes respectifs cryptés. Enfin xinetd s'occupera de mettre le serveur ftp en écoute quand un utilisateur se sera authentifié avec succès, puis d'inverser cet état dans le cas contraire, ainsi le serveur ne reste pas constamment en écoute et rajoute un petit plus en sécurité.<br /> <br /> Alors, pour réaliser tout cela, il nous faut installer <em>vsftpd, xinetd, apache2-utils</em> et la <em>libpam-pwdfile</em> si elle n'est pas présente.<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><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> vsftpd xinetd apache2-utils libpam-pwdfile</pre></pre></div><br /> On reviendra sur le pourquoi du apache2-utils...<br /> Observons la configuration par défaut de vsftpd :<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><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>vsftpd.conf <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">'#'</span></pre></pre></div><br /> On peux voir que la configuration ne correspond pas vraiment a ce que l'on cherche !<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">listen</span>=YES <span style="color: #007800;">anonymous_enable</span>=NO <span style="color: #007800;">local_enable</span>=YES <span style="color: #007800;">dirmessage_enable</span>=YES <span style="color: #007800;">use_localtime</span>=YES <span style="color: #007800;">xferlog_enable</span>=YES <span style="color: #007800;">connect_from_port_20</span>=YES <span style="color: #007800;">secure_chroot_dir</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>vsftpd<span style="color: #000000; font-weight: bold;">/</span>empty <span style="color: #007800;">pam_service_name</span>=vsftpd <span style="color: #007800;">rsa_cert_file</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>vsftpd.pem</pre></pre></div><br /> Il faut changer quelque paramétres, en enlever et en rajouter de sorte qu'à la fin, il ne doit rester que cela : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Le serveur n'écoute pas en continue.</span> <span style="color: #007800;">listen</span>=NO <span style="color: #666666; font-style: italic;">#Pas de connections anonymes.</span> <span style="color: #007800;">anonymous_enable</span>=NO <span style="color: #666666; font-style: italic;">#Connections des logins locaux acceptées</span> <span style="color: #007800;">local_enable</span>=YES <span style="color: #666666; font-style: italic;">#Les users hors système possèdent les mêmes privilèges que les locaux</span> <span style="color: #007800;">virtual_use_local_privs</span>=YES <span style="color: #666666; font-style: italic;">#On autorise les manipulations de fichiers via ftp. Au choix.</span> <span style="color: #007800;">write_enable</span>=YES <span style="color: #666666; font-style: italic;">#On autorise les connections sur le port 20.</span> <span style="color: #007800;">connect_from_port_20</span>=YES <span style="color: #666666; font-style: italic;">#Nom du service déclaré dans la configuration Pam.</span> <span style="color: #007800;">pam_service_name</span>=vsftpd <span style="color: #666666; font-style: italic;">#On autorise les connections invitées afin de les &quot;convertir&quot; vers une nouvelle identité.</span> <span style="color: #007800;">guest_enable</span>=YES <span style="color: #666666; font-style: italic;">#Puisque c'est pour manipuler du contenu web, www-data et l identité qui convient.</span> <span style="color: #007800;">guest_username</span>=www-data <span style="color: #666666; font-style: italic;">#Permet de créer des répertoires personnels à la volée en fonction du contenu de guest_username.</span> <span style="color: #666666; font-style: italic;">#Si l utilisateur est www-data, son répertoire devrait être /var/www/homes/$USER.</span> <span style="color: #666666; font-style: italic;">#Ainsi chaque guest aura son répertoire perso dans /var/www/ .</span> <span style="color: #007800;">user_sub_token</span>=<span style="color: #007800;">$USER</span> <span style="color: #666666; font-style: italic;">#Sera la racine du serveur ftp</span> <span style="color: #007800;">local_root</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$user</span> <span style="color: #666666; font-style: italic;">#On emprisonne les processus utilisateurs</span> <span style="color: #007800;">chroot_local_user</span>=YES <span style="color: #666666; font-style: italic;">#Cette option permet d'afficher TOUS les fichiers sous l identité ftp:ftp.</span> <span style="color: #666666; font-style: italic;">#Permet également de masquer le nom du serveur. </span> <span style="color: #007800;">hide_ids</span>=YES <span style="color: #666666; font-style: italic;">#On conserve une trace de toute connections ou tentative.</span> <span style="color: #007800;">xferlog_enable</span>=YES <span style="color: #666666; font-style: italic;">#On détermine ou seront les fichier de configuration de chaque utilisateur virtuel.</span> <span style="color: #007800;">user_config_dir</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd<span style="color: #000000; font-weight: bold;">/</span>vsftpd_user_conf</pre></pre></div><br /> J'espère que mes commentaires sont suffisamment clair et explicite.<br /> <br /> Passons à l'authentification, on a prévenu <em>vsftp</em> que les utilisateurs passeraient voir Pam pour s'authentifier avant de rentrer, parce que Pam, elle est chouette, elle s'occupe d'authentifier tout un tas de services et gens si on lui demande gentiment, il n'y a qu'à voir dans <em>/etc/pam.d/</em> pour s'en rendre compte... En installant vsftpd, on a installé une configuration Pam par défaut (comprise dans le paquet). Celle ci se base sur le fichier <em>ftpusers</em> et l'existence d'un vrai user, avec un shell distant... Et c'est moche !<br /> <br /> On à installé tout à l'heure le paquet apache2-utils, et bien celui ci permet de générer des fichier passwd pour les serveurs web, mais cela fonctione aussi sur le ftp, c'est un fichier de ce type qui va héberger l'identité de nos utilisateurs sous la forme login mot-de-passe. Donc nous allons créer un fichier <em>vsftpd.passwd</em> qui va contenir un utilisateur "test" mot de passe "test".<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-b</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd.passwd <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #7a0874; font-weight: bold;">test</span></pre></pre></div><br /> Voilà notre premier utilisateur guest créé, construisons lui son répertoire personnel dans /var/www, celui ci s'appelera test, forcément.<br /> Pour créer d'autres utilisateurs, la commande sera la suivante :<br /> htpasswd /etc/vsftpd.passwd utilisateur<br /> Le mot de passe du nouvel utilisateur sera demandé. A noter que ces utilisateurs sont "virtuels", ils sont extérieur au système et qu'il faudra leurs créer un home correspondant dans /var/www.<br /> <br /> Maintenant, il nous faut créer un fichier de configuration pour cet utilisateur test, un fichier qui va le restreindre un peu et qui se nommera test lui aussi, on le créé dans <em>/etc/vsftpd/vsftpd_user_conf/ </em> et on y place ça dedans : <br /> <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd<span style="color: #000000; font-weight: bold;">/</span>vsftpd_user_conf<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">test</span> &nbsp; <span style="color: #007800;">anon_world_readable_only</span>=NO <span style="color: #007800;">local_root</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #007800;">write_enable</span>=YES <span style="color: #007800;">anon_upload_enable</span>=YES <span style="color: #007800;">anon_mkdir_write_enable</span>=YES <span style="color: #007800;">anon_other_write_enable</span>=YES</pre></pre></div><br /> Là, on le restreint dans son seul et unique répertoire, il ne peut pas voir le reste du monde mais il peut cependant faire "ce qu'il lui plait" dedans.<br /> <br /> Nous allons maintenant renseigner le fichier de configuration de <em>vsftpd</em> dans <em>/etc/pam.d/</em> et changer les deux lignes en dessous de <em># Standart behaviour for ftpd(8)</em>.<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Standart behaviour for ftpd(8)</span> auth required pam_pwdfile.so <span style="color: #007800;">pwdfile</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd.passwd account required pam_permit.so</pre></pre></div><br /> Ici on a indiqué que Pam trouverait les cartes d'identités des utilisateurs autorisés dans le fichier <em>vsftpd.passwd</em> généré précédemment, on lui dit aussi que la bibliothèque <em>pam_pwdfile.so</em> lui permettrait de déchiffrer les passwords et qu'ainsi elle pourra ouvrir le compte utilisateur avec la clé <em>pam_permit.so</em><br /> La fin approche, il ne reste plus qu'a indiquer au super serveur xinetd qu'il doit réveiller vsftpd en cas de demande, pour cela, il suffit d'ajouter un fichier vsftpd dans /etc/xinetd.d/ et qui décrira les conditions du service.<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xinetd.d<span style="color: #000000; font-weight: bold;">/</span>vsftpd &nbsp; <span style="color: #666666; font-style: italic;"># Conditions pour le réveil du ftp</span> service <span style="color: #c20cb9; font-weight: bold;">ftp</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span> disable = no socket_type = stream <span style="color: #7a0874; font-weight: bold;">wait</span> = no user = root server = <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>vsftpd per_source = <span style="color: #000000;">5</span> instances = <span style="color: #000000;">200</span> only_from = 192.168.1.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> banner_fail = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd.busy_banner log_on_success += PID HOST DURATION log_on_failure += HOST <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></pre></div><br /> Détaillons un peut toutes ces options : <br /> <ul class="bb_ul"> <li class="bb_li"><em>disable</em> : Active ou non le service demandé. </li><li class="bb_li"><em>socket_type</em> : on détermine le type de binaire qui traitera le flux. </li><li class="bb_li"><em>wait </em>: Détermine si xinetd pourra gérer plusieurs connections. </li><li class="bb_li"><em>user</em> : Identité sous laquelle le service s'exécutera. </li><li class="bb_li"><em>server</em> : Chemin vers l'exécutable. </li><li class="bb_li"><em>per_source</em> : Détermine le nombre max de connections simultanées par adresse source. </li><li class="bb_li"><em>instances</em> : La même qu'au dessus, mais pour toutes les sources. </li><li class="bb_li"><em>only_from</em> : Détermine qui peut être une source. </li><li class="bb_li"><em>banner_fail </em>: Texte renvoyé si le serveur ne répond pas. </li><li class="bb_li"><em>log_on_success</em> : Permet de spécifier les infos qui seront inscrite dans les journaux </li><li class="bb_li"><em>log_on_failure</em> : La même qu'au dessus, mais pour les échecs de connections.<br /> </li></ul><br /> <br /> Voià, a partir d'ici, il suffit de relancer tous les services concernés pour que tout soit fonctionnel. Par la suite, notre utilisateur "test" pourra uploader ces fichiers sur son espace web via ftp, ceux ci seront visible immédiatement via un navigateur internet !<br /> <br /> Tout ceci est bien chouette et un peu plus sécurisé que la normale, mais les échanges ftp sur le réseau ne le sont pas tellement, pour remédier à cela, nous allons mettre en place SSL afin de chiffrer toutes ces transactions.... Je vous montrerai cela dans la deuxième partie de cet article. Fri, 18 Jun 2010 04:08:47 +0200 Le RAID facile sous linux... http://www.tekniko.fr/cms/articles/articles-2-45+le-raid-facile-sous-linux.php http://www.tekniko.fr/cms/articles/articles-2-45+le-raid-facile-sous-linux.php Vous disposez <a href="http://www.roadsidescholar.com/wp-content/uploads/2007/09/old_computer.jpg">d'un petit serveur</a> à la maison, confectionné avec du vieux matos récupéré de ci de là, et configuré aux petits oignons par vos soins...<br /> <br /> L'ennuie, c'est que ce vieux matos a souvent une fâcheuse tendance à réclamer son départ à la retraite, son disque dur fatigue prétend t'il... Mais crise oblige, l'heure n'est pas encore venue, et il va falloir bosser encore un peu ! Fort heureusement, dans le monde magique <a href="http://fr.wikipedia.org/wiki/Linux">Linux</a>, il existe des solutions pour remédier à ce problème, et il y en a de très simple !<br /> <br /> <br /> Nous allons aider le serveur en lui adjoignant un deuxième disque dur afin de seconder le premier, l'aider, le remplacer au besoin...<br /> Beaucoup de technique de Scout sont dispo pour faire cela, plus ou moins onéreuse... mais c'est la crise ! Et par chance, il se trouve que je dispose d'un second vieux disque planqué derrière des fagots... Et mon ami le manchot me dit à l'oreille :<br /> <br /> <span class="notice">Et si tu utilisai ce deuxième disque pour basculer le serveur sur un <a href="http://www.commentcamarche.net/contents/protect/raid.php3"> RAID </a> ??!!</span><br /> <br /> Je ne vais pas faire de cours sur le RAID et ces différents modes, il y a suffisamment de doc sur le <a href="http://desencyclopedie.wikia.com/wiki/Lancer_de_nain">nain Ternet</a>. Nous choisirons ici le <em>RAID 1</em>, également appelé <em>Mirroring</em> ou <em>disques en miroir</em>, grâce à ce mode, les données sont écrites de manière identique sur chaque disque qui compose la grappe, que se soit en RAID matériel, pseudo matériel ou logiciel.<br /> Cela nous apportera que des bonnes choses, en voici un pitch : <br /> <br /> <ul class="bb_ul"> <li class="bb_li"><strong><span style="text-decoration: underline;">Sécurité des données accrue.</span></strong><br /> si l'un de mes deux disques tombe, le contrôleur le désactive et l'autre prends le relai de façon transparente pour l'utilisateur. Une fois le disque défectueux remplacé, le contrôleur reconstruira les données sur le nouveau disque à l'aide de celui qui est toujours en fonction. </li><li class="bb_li"><strong><span style="text-decoration: underline;">Souplesse de fonctionnement.</span></strong><br /> Les accès en lecture du système se font sur le disque le plus facilement accessible à ce moment là et les écritures de façon simultanés, ainsi n'importe quel disque soit interchangeable n'importe quand (dixit Wikipédia).<br /> </li></ul><br /> <br /> <span class="notice">Nous suivront l'exemple didactique d'un article que j'ai lu sur le Linux Mag qui traite du sujet, et dont je reproduit une grande partie des manips ici.</span><br /> <br /> <strong><span style="font-size: 15px;">Passons aux choses sérieuses !</span></strong><br /> <br /> Notre vieux serveur est une vielle machine à l'age respectable et dont la config est la suivante : <br /> <br /> CPU AMD Athlon 1800 XP (1,33 Ghz)<br /> 1,5 Go de mémoire RAM<br /> 1er disque dur : 6 Go sata<br /> 2éme disque dur : 6 Go sata<br /> Système <a href="http://www.debian.org/releases/stable/">Debian Lenny</a><br /> <br /> La solution que nous allons mettre en place notre RAID 1 est la plus simple qui soit, comme je l'ai dis plus haut, c'est la crise, j'ai donc opté pour un contrôleur RAID logiciel, c'est à dire qu'il sera géré par le système d'exploitation du serveur (Ubuntu Gnu/Linux en l'occurrence) et non par un contrôleur dédier (sur une carte) bien trop couteux.<br /> <br /> <span class="success">Faisons un petit état des lieux et des manipulations avant toutes choses : </span><br /> <span style="text-decoration: underline;"><br /> 1 =&gt; La config des disques avant le RAID</span><br /> <br /> <span class="text_code">Code TEXT :</span><div class="code"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">disque 1 /dev/sda (disque d'origine) Partitions : /dev/sda1 montée sur / /dev/sda2 montée sur /boot /dev/sda3 partition de swap &nbsp; disque 2 /dev/sdb (disque que l'on va ajouter) Partitions : Vierge</pre></pre></div><br /> <br /> <span style="text-decoration: underline;">2 =&gt; Les manipulations</span><br /> <br /> A : Partitionnement du second disque<br /> B : Installation du contrôleur RAID<br /> C : Configuration du second disque et intégration dans la grappe nouvellement créée.<br /> D : Configuration et intégration du premier disque dans la grappe<br /> <br /> <strong><span style="text-decoration: underline;">État des lieux de sortie : </span></strong><br /> <br /> Config des disques avec le RAID 1 :<br /> <br /> <span class="text_code">Code TEXT :</span><div class="code"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&quot;disque&quot; RAID monté sur /dev/md Partitions : /dev/md0 monté sur / /dev/md1 monté sur /boot /dev/md2 partition de swap</pre></pre></div><br /> <br /> <br /> <strong><span style="text-decoration: underline;">A : Partitionnement du second disque</span></strong><br /> pour se faire, nous utiliserons <a href="http://www.linux-kheops.com/doc/man/manfr/man-html-0.9/man8/sfdisk.8.html">sfdisk</a>, celui ci nous permet de partitionner le second disque a l'identique du premier grâce à une simple commande ! <br /> La voici pour notre cas présent : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">sfdisk - d <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda <span style="color: #000000; font-weight: bold;">|</span> sfdisk <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb</pre></pre></div><br /> Il se peut que le terminal ronchonne un peu mais cela n'est pas important, nous pouvons vérifier la sortie de cette commande en faisant un fdisk -l et ainsi voir que notre deuxième disque est bien partitionné.<br /> <br /> <br /> <strong><span style="text-decoration: underline;">B : Installation du contrôleur RAID</span></strong><br /> Ce contrôleur sera <a href="http://www.noisette.ch/wiki/index.php/Mdadm">MDADM</a>, il est intéressant car il va nous permettre de construire notre grappe RAID 1 avec seulement un disque dur, grâce à l'option <em>missing</em>...<br /> <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><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> mdadm</pre></pre></div><br /> <br /> puis nous chargeons le module raid1<br /> <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">modprobe raid1</pre></pre></div><br /> <br /> Nous pouvons maintenant créer notre grappe en utilisant uniquement un seul disque (/dev/sdb) !! Et ce, grâce à l'option <em>missing</em> de mdadm.<br /> Commençons :<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp; mdadm <span style="color: #660033;">--create</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md0 <span style="color: #660033;">--level</span>=<span style="color: #000000;">1</span> <span style="color: #660033;">--raid-disks</span>=<span style="color: #000000;">2</span> missing <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1 mdadm <span style="color: #660033;">--create</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md1 <span style="color: #660033;">--level</span>=<span style="color: #000000;">1</span> <span style="color: #660033;">--raid-disks</span>=<span style="color: #000000;">2</span> missing <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb2 mdadm <span style="color: #660033;">--create</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2 <span style="color: #660033;">--level</span>=<span style="color: #000000;">1</span> <span style="color: #660033;">--raid-disks</span>=<span style="color: #000000;">2</span> missing <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb3</pre></pre></div><br /> <span class="notice">Nous pouvons vérifier que notre grappe est bien créée en faisant un simple <em>cat /proc/mdstat</em></span><br /> <br /> Créons ensuite les systèmes de fichiers du <em>RAID</em>, ceux ci doivent être identique à ceux correspondant sur /dev/sda, ici c'est du ext3, l'autre partition est une partition de swap.<br /> <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp; mkfs.ext3 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md0 mkfs.ext3 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md1 mkswap <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2</pre></pre></div><br /> Pour activer notre grappe, il faut maintenant renseigner le fichier de conf du contrôleur raid (mdadm), en prenant soin de conserver une copie d'origine, non seulement par sécurité, mais aussi parce qu'il nous sera utile par la suite...<br /> <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mdadm<span style="color: #000000; font-weight: bold;">/</span>mdadm.conf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mdadm<span style="color: #000000; font-weight: bold;">/</span>mdadm.conf-origine</pre></pre></div><br /> <br /> Pour nous simplifier encore plus la vie, il y a une commande magique (glanée sur la revue <a href="http://www.gnulinuxmag.com/">Linux Magazine</a>, comme beaucoup de cet article)<br /> <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">mdadm <span style="color: #660033;">--examine</span> <span style="color: #660033;">--scan</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mdadm<span style="color: #000000; font-weight: bold;">/</span>mdadm.conf</pre></pre></div><br /> <br /> <span class="success">Voilà ! Notre RAID 1 unijambiste est maintenant monté !</span><br /> <br /> <br /> Continuons, il faut désormais copier les données de /dev/sda sur notre <em>RAID</em> bancale (celui ci ne comprend que /dev/sdb pour le moment). Pour cela, nous allons monter une partie du <em>RAID</em> dans un dossier afin d'y copier notre futur système de fichier racine.<br /> <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>md0 <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md0 <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>md0 <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>md1 <span style="color: #c20cb9; font-weight: bold;">mount</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>mnt<span style="color: #000000; font-weight: bold;">/</span>md1</pre></pre></div><br /> <br /> Puis copions tout le système : <br /> <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp; <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-dpRx</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>md1 <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>boot <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-dpRx</span> . <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>md0<span style="color: #000000; font-weight: bold;">/</span>boot</pre></pre></div><br /> <br /> Détaillons ces options (<a href="http://www.bash-linux.com/unix-man-cp-francais.html">man cp</a>) : <br /> <ul class="bb_ul"> <li class="bb_li">-d : Pour copier les liens symboliques en tant que tels. </li><li class="bb_li">-p : Pour conserver les attributs des fichiers (propriétaire, groupe etc...). </li><li class="bb_li">-R : Pour copier récursivement les répertoires. </li><li class="bb_li">-x : Interdit de changer de système de fichier en cours de copie, c'est pour cela qu'il faut relancer l'opération.<br /> </li></ul><br /> <br /> Préparons maintenant la futur <em>fstab</em> de notre grappe ! Il faut l'éditer dans <em>/mnt/md0</em> et remplacer les entrées <em>sda</em> par les entrées md correspondantes de sorte d'obtenir quelque chose comme ça (pour notre config à nous bien sur) :<br /> <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp; <span style="color: #666666; font-style: italic;"># &lt;file system&gt; &lt;mount point&gt; &lt;type&gt; &lt;options&gt; &lt;dump&gt; &lt;pass&gt;</span> proc <span style="color: #000000; font-weight: bold;">/</span>proc proc defaults <span style="color: #000000;">0</span> <span style="color: #000000;">0</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> ext3 relatime,<span style="color: #007800;">errors</span>=remount-ro <span style="color: #000000;">0</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md0 <span style="color: #000000; font-weight: bold;">/</span>boot ext3 defauts <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2 none swap sw <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>scd0 <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>cdrom0 udf,iso9660 user,noauto,<span style="color: #7a0874; font-weight: bold;">exec</span>,utf8 <span style="color: #000000;">0</span> <span style="color: #000000;">0</span></pre></pre></div><br /> <br /> <br /> Après tout cela, il faut prévenir l'ami Grub que quelque chose à changer, il faut lui ajouter une entrée supplémentaire pour pouvoir booter sur le Raid... En éditant son menu avec ça, il devrait nous entendre : <br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>menu.lst</pre></pre></div><br /> <br /> Premièrement, on lui dit qu'avec la commande <strong><a href="http://www.linux-france.org/article/sys/chargeurs/ix86/grub/grub-manual-fr.html">fallback 1</a></strong> placée juste en desous du paramétre <strong><a href="http://www.linux-france.org/article/sys/chargeurs/ix86/grub/grub-manual-fr.html">defaut 0</a></strong>, si le boot sur le Raid ne fonctionne pas, il tentera de booter sur l'autre entrée par défaut, soit l'entrée "d'origine".<br /> <br /> Deuxiémement, rajoutons le noyau du Raid qui se trouve sur /dev/md1. Il suffit de recopier le premier bloc de kernel juste en dessous de celui ci, en changeant seulement l'adresse du <em>kernel root</em>, cela doit donner quelque chose comme ça :<br /> <img src="http://www.tekniko.fr/cms/upload/menu_grub.png" alt="" class="valign_" /><br /> on met jour de l'image initiale <strong><a href="http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/Introducing-initramfs-a-new-model-for-initial-RAM-disks/">initramfs</a></strong><br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">update-initramfs <span style="color: #660033;">-u</span></pre></pre></div><br /> pour finir en installant grub sur notre second disque, qui sera notre Raid unijambiste après le prochain reboot, si tout se passe bien...<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">grub grub<span style="color: #000000; font-weight: bold;">&gt;</span> root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd1,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> grub<span style="color: #000000; font-weight: bold;">&gt;</span> setup <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd1<span style="color: #7a0874; font-weight: bold;">&#41;</span> grub<span style="color: #000000; font-weight: bold;">&gt;</span> quit</pre></pre></div><br /> Voili voilou, à partir de là, on peut redémarrer et booter sur notre raid si tout va bien ! ....Et en choisissant la bonne entrée aussi...<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">shutdown now <span style="color: #660033;">-r</span></pre></pre></div><br /> <br /> <!-- START HTML --> <center><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="450" height="350" id="csSWF"> <param name="movie" value="http://www.tekniko.fr/cms/articles/re-reboot_controller.swf" /> <param name="quality" value="best" /> <param name="bgcolor" value="#1a1a1a" /> <param name="allowfullscreen" value="true" /> <param name="scale" value="showall" /> <param name="allowscriptaccess" value="always" /> <param name="flashvars" value="autostart=false&thumb=FirstFrame.png&thumbscale=45&color=transparent" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="http://www.tekniko.fr/cms/articles/re-reboot_controller.swf" width="450" height="350"> <param name="quality" value="best" /> <param name="bgcolor" value="#1a1a1a" /> <param name="allowfullscreen" value="true" /> <param name="scale" value="showall" /> <param name="allowscriptaccess" value="always" /> <param name="flashvars" value="autostart=false&thumb=FirstFrame.png&thumbscale=45&color=transparent" /> <!--<![endif]--> <!--[if !IE]>--> </object> <!--<![endif]--> </object></center> <!-- END HTML --><br /> <span class="success">Le boot sur le Raid c'est bien passé, vous avez pu voir la grappe prendre la main en se peuplant avec seulement un disque ! </span><br /> <br /> Après s'être logué, on peut voir que nous somme bien sur le Raid en vérifiant :<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md1 on <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">type</span> ext3 <span style="color: #7a0874; font-weight: bold;">&#40;</span>rw,realtime,<span style="color: #007800;">errors</span>=remount -ro<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md0 on <span style="color: #000000; font-weight: bold;">/</span>boot <span style="color: #7a0874; font-weight: bold;">type</span> ext3 <span style="color: #7a0874; font-weight: bold;">&#40;</span>rw<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></pre></div><br /> <br /> Il ne reste désormais plus qu'à intégrer le premier disque dur (celui qui commence à ce faire un peu vieux) dans la grappe, ainsi elle sera complète et pleinement opérationnelle.<br /> Pour bien faire les choses, il faut déclarer toutes les partitions du disque en <em>Linux raid Autodetect</em> (fd) avec la commande fdisk, option t pour changer le type, puis fd pour linux raid autodetect, et il faut le faire pour chaque partitions.<br /> Cela prend très peu de temps et après avoir fait ça, on peut basculer le disque dur ( pour mémoire, on partait de lui au début ! ) dans la grappe.<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">mdadm <span style="color: #660033;">--add</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md0 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1 mdadm <span style="color: #660033;">--add</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>dev<span style="color: #000000; font-weight: bold;">/</span>sda2 mdadm <span style="color: #660033;">--add</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda3</pre></pre></div><br /> A partir de ce moment là, mdadm commence a synchroniser /dev/sda a l'identique de /dev/sdb puisque tout deux forment /dev/md et l'on peut voir cette synchronisation tout simplement en tapant ceci :<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>mdstat</pre></pre></div><br /> Enfin nous allons remettre le fichier de conf de mdadm à zéro, puis nous le réinitialisera avec nos nous paramètres.<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mdadm<span style="color: #000000; font-weight: bold;">/</span>mdadm.conf-origine <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mdadm<span style="color: #000000; font-weight: bold;">/</span>mdadm.conf mdadm <span style="color: #660033;">--examine</span> <span style="color: #660033;">--scan</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mdadm<span style="color: #000000; font-weight: bold;">/</span>mdadm.conf</pre></pre></div><br /> <span class="success">Voila, nous venons de basculer notre serveur sur un RAID 1 en toute sécurité !</span><br /> Si l'on veut gagner encore un poil plus de sécu sur le boot, on peut modifier grub pour qu'il nous affiche chacun des principaux noyaux sur chacun des disques et systèmes de fichier.<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp; title Debian GNU<span style="color: #000000; font-weight: bold;">/</span>linux, RAID kernel 2.6.26-<span style="color: #000000;">2</span>-<span style="color: #000000;">686</span> 1er_disque root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> kernel <span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.26-<span style="color: #000000;">2</span>-<span style="color: #000000;">686</span> <span style="color: #007800;">root</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md1 ro quiet initrd <span style="color: #000000; font-weight: bold;">/</span>initrd.img-2.6.26-<span style="color: #000000;">2.686</span> &nbsp; title Debian GNU<span style="color: #000000; font-weight: bold;">/</span>linux, RAID kernel 2.6.26-<span style="color: #000000;">2</span>-<span style="color: #000000;">686</span> root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd1,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> kernel <span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.26-<span style="color: #000000;">2</span>-<span style="color: #000000;">686</span> <span style="color: #007800;">root</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md1 ro quiet initrd <span style="color: #000000; font-weight: bold;">/</span>initrd.img-2.6.26-<span style="color: #000000;">2.686</span> &nbsp; title Debian GNU<span style="color: #000000; font-weight: bold;">/</span>linux, kernel 2.6.26-<span style="color: #000000;">2</span>-<span style="color: #000000;">686</span> 1er_disque root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> kernel <span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.26-<span style="color: #000000;">2</span>-<span style="color: #000000;">686</span> <span style="color: #007800;">root</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda2 ro quiet initrd <span style="color: #000000; font-weight: bold;">/</span>initrd.img-2.6.26-<span style="color: #000000;">2.686</span> &nbsp; title Debian GNU<span style="color: #000000; font-weight: bold;">/</span>linux, kernel 2.6.26-<span style="color: #000000;">2</span>-<span style="color: #000000;">686</span> root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd1,<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> kernel <span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.26-<span style="color: #000000;">2</span>-<span style="color: #000000;">686</span> <span style="color: #007800;">root</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb2 ro quiet initrd <span style="color: #000000; font-weight: bold;">/</span>initrd.img-2.6.26-<span style="color: #000000;">2.686</span> &nbsp;</pre></pre></div><br /> <br /> Remise à jour d'initramfs :<br /> <span class="text_code">Code BASH :</span><div class="code"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">update-initramfs <span style="color: #660033;">-u</span></pre></pre></div><br /> <br /> The end.<br /> <br /> Sources : <br /> <br /> linux Magazine (un très bon article de Cedric Pellerin)<br /> Linux France<br /> Manuel de cp<br /> manuel de mdadm Fri, 18 Jun 2010 04:05:23 +0200 Monitoring système avec conky... http://www.tekniko.fr/cms/articles/articles-2-41+monitoring-systeme-avec-conky.php http://www.tekniko.fr/cms/articles/articles-2-41+monitoring-systeme-avec-conky.php Conky est un petit programme permettant de surveiller les constantes de son système, ainsi que d'autres choses plus ou moins futiles....<br /> <br /> Sur cet article, je ne parlerai et ne prendrai comme exemple que ma configuration personnel, si vous désirez en savoir plus sur ces autres fonctions, je vous invite à consulter les sources qui seront indiquées en bas de cette page...<br /> <br /> <br /> <br /> <span style="text-decoration: underline;"><strong>Précisions</strong></span><br /> <br /> <em>Les fichiers de configurations présentés ici tournent sur une Ubuntu 9.04 ainsi que sur une Debian Etch.</em><br /> <br /> <br /> Pour ma part, je me contente de surveiller que quelques constantes de mon cpu, de mon disque, des processus ainsi que du réseau.<br /> <br /> Voici mon fichier de configuration : <br /> <span class="text_code">Code BBCODE :</span><div class="code"><pre> background no update_interval 1.0 double_buffer yes use_xft yes override_utf8_locale xftfont Sans:size=8 xftalpha 0.8 own_window yes own_window_transparent yes own_window_type override own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager #on_bottom yes minimum_size 280 5 maximum_width 220 draw_shades no draw_outline no draw_borders no draw_graph_borders yes stippled_borders 0 border_margin 3 border_width 0 default_color black default_shade_color black default_outline_color black color1 807d7d color2 b8c0cb color3 FC8820 alignment middle_right gap_x 20 gap_y 40 no_buffers yes TEXT ${font Ozone:style=Bold:size=10} ${alignr}$color SYSTEME $stippled_hr${font Sans:style=Bold:pixelsize=8} ${alignc}${color1}$nodename - $sysname $kernel on $machine ${alignc}${color1}CPU : $color AMD 1800+ ${alignc}${color1}Fréquence : $color ${freq_g} GHz ${alignc}${color1}CPU Utilisé :$color $cpu% ${color1}${cpugraph FFFFFF 000000} ${alignc}${color1}Uptime:$color $uptime ${color1}- Load:$color $loadavg ${alignc}${color1}Mémoire RAM :$mem/$memmax - $memperc% ${alignc}${color1}Mémoire ${alignc}${color1}RAM : $color$mem / $memmax $memperc % ${color2}${membar} ${alignc}${color1}Utilisation du SWAP : $color$swap / $swapmax $swapperc % ${color2}${swapbar} ${color black}Processus:$alignc Memory:$alignr Cpu Used ${color #e49c16}${top name 1} $alignc ${top mem 1}${color black}$alignr${top cpu 1} ${color #e49c16}${top name 2} $alignc ${top mem 2}${color black}$alignr${top cpu 2} ${color #e49c16}${top name 3} $alignc ${top mem 3}${color black}$alignr${top cpu 3} ${color #e49c16}${top name 4} $alignc ${top mem 4}${color black}$alignr${top cpu 4} ${color #e49c16}${top name 5} $alignc ${top mem 5}${color black}$alignr${top cpu 5} ${color #e49c16}${top name 6} $alignc ${top mem 6}${color black}$alignr${top cpu 6} ${color #e49c16}${top name 7} $alignc ${top mem 7}${color black}$alignr${top cpu 7} ${color #e49c16}${top name 8} $alignc ${top mem 8}${color black}$alignr${top cpu 8} ${color #e49c16}${top name 9} $alignc ${top mem 9}${color black}$alignr${top cpu 9} ${font Ozone:style=Bold:size=10} ${alignr}$color HDD $stippled_hr${font Sans:style=Bold:pixelsize=8} ${color1}Linux : $color${fs_used /} / ${fs_size /} $color${fs_used_perc /}% ${color2}${fs_bar /} ${font Ozone:style=Bold:size=10} ${alignr}$color RESEAU $stippled_hr${font Sans:style=Bold:pixelsize=8} ${alignc}${color1}IP Distante : $color${execi 60 wget -O - <span style="color:#0000FF;">[url</span>=<span style="color:#7B00FF;">http://ip.tupeux.com</span><span style="color:#0000FF;">]</span>http://ip.tupeux.com<span style="color:#0000FF;">[/url]</span> | tail} ${color1}Ethernet : $color${addr eth0} ${color1}Download : $color${downspeed eth0} kiB/s ${alignr}${color1}Upload : $color${upspeed eth0} kiB/s ${color1}Total : $color${totaldown eth0} ${alignr}${color1}Total : $color${totalup eth0}</pre></div><br /> <br /> <br /> <br /> Ici, quelques paramètres sont important, notamment pour l'intégration au bureau, à noter que je n'utilise pas le gestionnaire Compiz, mon chipset graphique ne me le permet pas.<br /> <br /> Voici ce qu'il faut bien vérifier : <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> <br />own_window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;On&nbsp;dit&nbsp;à&nbsp;Conky&nbsp;de&nbsp;ne&nbsp;pas&nbsp;se&nbsp;mettre&nbsp;sur&nbsp;le&nbsp;bureau&nbsp;mais&nbsp;dans&nbsp;une&nbsp;fenêtre&nbsp;propre <br />&nbsp;own_window_type&nbsp;&nbsp;&nbsp;override&nbsp;&nbsp;#&nbsp;type&nbsp;de&nbsp;fenêtre&nbsp;"maison"&nbsp;(le&nbsp;type&nbsp;desktop&nbsp;convient&nbsp;si&nbsp;on&nbsp;n'a&nbsp;pas&nbsp;d'ombre) <br />&nbsp;own_window_hints&nbsp;&nbsp;undecorated,below,sticky,skip_taskbar,skip_pager&nbsp;#&nbsp;définition&nbsp;du&nbsp;type&nbsp;</span> </code></div><br /> <br /> Ces détails sont très importants<br /> <br /> J'utilise ensuite un deuxieme fichier de config, un peu fioriture, juste pour m'afficher la date, l'heure, le jour...<br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> background&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no <br />update_interval&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.0 <br />double_buffer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br /> <br />use_xft&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br />override_utf8_locale <br />xftfont&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LCD:size=8 <br />xftalpha&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.8 <br /> <br />own_window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br />own_window_transparent&nbsp;&nbsp;&nbsp;&nbsp;yes <br />own_window_type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;override <br />own_window_hints&nbsp;&nbsp;&nbsp;&nbsp;undecorated,below,sticky,skip_taskbar,skip_pager <br />#on_bottom&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br /> <br />minimum_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;280&nbsp;5 <br />maximum_width&nbsp;247 <br />draw_shades&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no <br />draw_outline&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no <br />draw_borders&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no <br />draw_graph_borders&nbsp;&nbsp;&nbsp;&nbsp;yes <br />stippled_borders&nbsp;&nbsp;&nbsp;&nbsp;0 <br />border_margin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3 <br />border_width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 <br /> <br />default_color&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;black <br />default_shade_color&nbsp;&nbsp;&nbsp;&nbsp;black <br />default_outline_color&nbsp;&nbsp;&nbsp;&nbsp;black <br />color1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5B8DCF <br />color2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8BAEE8 <br />color3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;858585 <br /> <br />alignment&nbsp;bottom_middle <br />gap_x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 <br />gap_y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;60 <br /> <br />no_buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br />own_window_hints&nbsp;undecorated,below,sticky,skip_taskbar,skip_pager <br /> <br />TEXT <br />$color${font&nbsp;Ozone:style=Normal:size=16}${alignc}.:&nbsp;$color${time&nbsp;%H:%M:%S}$color&nbsp;:. <br />${font&nbsp;sans:size=10}${alignc}.:&nbsp;$color${time&nbsp;%A&nbsp;%d&nbsp;%B&nbsp;%Y}$color&nbsp;:.</span> </code></div><br /> <br /> Puis enfin un dernier m'affichant l'utilisateur connecté (des fois que j'oublie qui je suis ! ) ainsi que le temps d'uptime et la version du kernel..<br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> background&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no <br />update_interval&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.0 <br />double_buffer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br /> <br />use_xft&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br />override_utf8_locale <br />xftfont&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sans:size=8 <br />xftalpha&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.8 <br /> <br />own_window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br />own_window_transparent&nbsp;&nbsp;&nbsp;&nbsp;yes <br />own_window_type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;override <br />own_window_hints&nbsp;undecorated,below,sticky,skip_taskbar,skip_pager <br />on_bottom&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br /> <br />minimum_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1280&nbsp;5 <br />maximum_width&nbsp;300 <br />draw_shades&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no <br />draw_outline&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no <br />draw_borders&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no <br />draw_graph_borders&nbsp;&nbsp;&nbsp;&nbsp;yes <br />stippled_borders&nbsp;&nbsp;&nbsp;&nbsp;0 <br />border_margin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3 <br />border_width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 <br /> <br />default_color&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;black <br />default_shade_color&nbsp;&nbsp;&nbsp;&nbsp;black <br />default_outline_color&nbsp;&nbsp;&nbsp;&nbsp;black <br />color1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;807d7d <br />color2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b8c0cb <br />color3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FC8820 <br /> <br />alignment&nbsp;top_middle <br />gap_x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 <br />gap_y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;40 <br /> <br />no_buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes <br /> <br />TEXT <br />${font&nbsp;Sans:style=Bold:pixelsize=10}${color1}L'utilisateur$color&nbsp;${exec&nbsp;whoami}&nbsp;${color1}est&nbsp;connecté&nbsp;depuis&nbsp;$color&nbsp;$uptime <br />${alignc}${color1}Kernel&nbsp;:&nbsp;$color$kernel&nbsp;&nbsp; <br /></span> </code></div><br /> <br /> Quelques autres paramétres important, pour le placement des différents conky sur le bureau : <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> <br />alignment&nbsp;top_middle <br />gap_x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 <br />gap_y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;40</span> </code></div><br /> <br /> Inutile d'apporter des précisions ? Si ? <br /> <br /> <strong>gap_x</strong> =&gt; Pour le placement horizontal (en pixel)<br /> <strong>gap_y</strong> =&gt; " " " verticale (en pixel)<br /> <strong>alignment_middle</strong> =&gt; Pour center, mais se pourrait être left ou right !<br /> <br /> Pour tester vos conky, vous pouvez ouvrir une invite de commande en tapant sur "alt+f2", ainsi, conky sera lancé en arriere plan mais s'affichera tout de même, pour le tuer, un simple "killall conky" dans une console suffit !<br /> <br /> <br /> Afin d'automatiser le lancement au debut de chaque session, je vous propose le petit script suivant : <br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> #!/bin/bash <br />sleep&nbsp;15; <br />conky&nbsp;-c&nbsp;.conkyrc1&nbsp;&amp;&nbsp;conky&nbsp;-c&nbsp;.conkyrc2&nbsp;&amp;&nbsp;conky&nbsp;-c&nbsp;.conkyrc</span> </code></div><br /> <br /> Il ne vous reste plus qu'a lui donner les droit d'execution (sudo chmod 755) et le placer dans la liste des programmes a lancer au démarrage !<br /> <br /> Un petit screenshot histoire de montrer a quoi resemble les conkys avec ces config : <br /> <br /> <a href="http://www.tekniko.fr/images/Linux/Capture.png"><img src="http://www.tekniko.fr/images/Linux/Capture-mini.png" alt="" class="valign_" /></a><br /> <br /> <strong>Sources : </strong><br /> <br /> <a href="http://conky.sourceforge.net/">Le site du projet Conky</a><br /> <a href="http://doc.ubuntu-fr.org/conky">La doc sur Ubuntu</a> Tue, 04 Aug 2009 14:52:01 +0200 HADOPI : Riposte inégale.... http://www.tekniko.fr/cms/articles/articles-10-35+hadopi-riposte-inegale.php http://www.tekniko.fr/cms/articles/articles-10-35+hadopi-riposte-inegale.php Je fais ici l'&eacute;cho de cet appel, afin qu'un maximum de monde puisse voir cela, et agir !!<br /> <br /> Parce que peut &ecirc;tre qu'un jour, c'est Tekniko.fr qui sera blacklist&eacute;....<br /> <br /> <span class="text_blockquote">Citation:</span><div class="blockquote">APPEL HADOPI : &laquo;black-out&raquo; du Net fran&ccedil;ais<br /> Soumis par pi le 25 f&eacute;vrier, 2009 - 02:06.<br /> <br /> <br /> Paris, le 25 f&eacute;vrier - Devant le ridicule d'un gouvernement qui s'ent&ecirc;te &agrave; vouloir d&eacute;connecter du Net des familles enti&egrave;res sans preuves valables ni proc&egrave;s, la Quadrature appelle les citoyens &eacute;pris de libert&eacute; &agrave; proc&eacute;der au &laquo; black-out &raquo; de leurs sites, blogs, profils, avatars, etc. Comme en Nouvelle-Z&eacute;lande, seul pays avec la France o&ugrave; la &laquo; riposte gradu&eacute;e &raquo; devait &ecirc;tre impos&eacute;e par la loi, pour finalement &ecirc;tre repouss&eacute;e : pour protester contre cette loi imb&eacute;cile et sa &laquo; liste blanche &raquo; de sites autoris&eacute;s, le Net fran&ccedil;ais doit agir et se draper de noir.<br /> <br /> La Nouvelle-Z&eacute;lande &eacute;tait &agrave; ce jour le seul autre pays &agrave; part la France o&ugrave; devait &ecirc;tre vot&eacute;e une loi aussi stupide que la &laquo; riposte gradu&eacute;e &raquo; voulue par N. Sarkozy, d&eacute;fendue par C. Albanel dans la loi HADOPI, et bient&ocirc;t vot&eacute;e &agrave; l'Assembl&eacute;e nationale. Elle vient d'&ecirc;tre repouss&eacute;e gr&acirc;ce &agrave; une mobilisation massive, durant laquelle le web n&eacute;o-z&eacute;landais a proc&eacute;d&eacute; &agrave; son &laquo; black-out &raquo; volontaire.<br /> <br /> &laquo; C'est un signal fort qui illustre la b&ecirc;tise et la dangerosit&eacute; de cette loi. La &quot;riposte gradu&eacute;e&quot; fera condamner des innocents, sans preuve valable et sans proc&egrave;s. Elle ne fera pas gagner un centime de plus aux artistes et ne changera rien aux probl&egrave;mes strat&eacute;giques et structurels &agrave; l'origine de la crise que traversent les industries qui la demandent. &raquo; d&eacute;clare J&eacute;r&eacute;mie Zimmermann, porte-parole de La Quadrature du Net.&laquo; Pour aller au bout de cette logique r&eacute;pressive, le gouvernement a d&eacute;clar&eacute; qu'il imposerait de filtrer tous les acc&egrave;s wi-fi publics &agrave; une &quot;liste blanche&quot;1 de sites autoris&eacute;s. Cela n'a pas de sens. Il faut r&eacute;agir en montrant l'immensit&eacute; de ce web d&eacute;cid&eacute; &agrave; ne pas devenir d&eacute;finitivement noir. &raquo;<br /> <br /> La Quadrature invite tous ses soutiens, individus et collectifs, &agrave; :<br /> <br /> * Peindre leurs sites, blogs, profils, courriers, commentaires ou avatars de la couleur noire du &laquo; black-out &raquo;, au besoin en utilisant les images mises &agrave; leur disposition2.<br /> * Afficher un message expliquant les motivations de cette protestation contre une loi absurde, inapplicable et dangereuse qui met en p&eacute;ril le web fran&ccedil;ais, l'innovation, et les libert&eacute;s fondamentales3.<br /> * Faire un lien vers le &laquo; tableau de bord HADOPI &raquo;4 de La Quadrature du Net.<br /> * Contacter son d&eacute;put&eacute;5 pour lui annoncer que l'on a proc&eacute;d&eacute; au &laquo; black-out &raquo; de son espace sur le Net pour protester contre la loi &laquo; Cr&eacute;ation et Internet &raquo;, lui transmettre le dossier de La Quadrature6 et lui demander ce qu'il en pense.<br /> * Inviter ses proches et ses contacts &agrave; faire de m&ecirc;me.<br /> <br /> <br /> &laquo; Cet appel est un hommage rendu aux citoyens n&eacute;o-z&eacute;landais qui ont pu faire entendre la raison &agrave; leur gouvernement. Il s'agit d'un remix, d'une r&eacute;appropriation d'une id&eacute;e qui, comme la culture, n'existe que pour &ecirc;tre partag&eacute;e. Ce sont ceux qui traitent leurs clients de &quot; pirates &quot; et les d&eacute;put&eacute;s qui votent leurs lois qu'il faudrait d&eacute;connecter !&raquo;7<br /> <br /> &laquo; Le Net s'est fait pour et par ses utilisateurs. Quelques entreprises archa&iuml;ques et les politiciens qui tentent de le contr&ocirc;ler n'ont toujours pas compris comment fonctionnait le Net. Tous ensemble nous sommes infiniment plus intelligents et puissants qu'eux et devons le leur montrer, agir pour prot&eacute;ger nos libert&eacute;s et l'architecture ouverte du r&eacute;seau. &raquo; conclut Zimmermann, l&eacute;g&egrave;rement courrouc&eacute;.</div><br /> <br /> Voici quelques liens : <br /> <br /> <p style="text-align:center">Pour les banni&egrave;res et autres gif =&gt; <a href="http://www.laquadrature.net/fr/HADOPI-blackout-images-bandeaux-boutons-bannieres">http://www.laquadrature.net/fr/HADOPI-blackout-images-bandeaux-boutons-bannieres</a><br /> <br /> Le tableau de bord HADOPI =&gt; <a href="http://www.laquadrature.net/HADOPI">http://www.laquadrature.net/HADOPI</a><br /> <br /> Le dossier de la Quadrature =&gt; <a href="http://www.laquadrature.net/files/LaQuadratureduNet-Riposte-Graduee_reponse-inefficace-inapplicable-dangereuse-a-un-faux-probleme.pdf">http://www.laquadrature.net/files/LaQuadratureduNet-Riposte-Graduee_reponse-inefficace-inapplicable-dangereuse-a-un-faux-probleme.pdf</a></p> Thu, 26 Feb 2009 14:47:01 +0100 CurlftpFs => Son FTP en local ! http://www.tekniko.fr/cms/articles/articles-2-32+curlftpfs-son-ftp-en-local.php http://www.tekniko.fr/cms/articles/articles-2-32+curlftpfs-son-ftp-en-local.php Depuis longtemps, je rame pour le transfert de mes fichiers locaux vers mon hébergeur, l'heure été venue de trouver un autre moyen pour ce faire, histoire de simplifier les choses !<br /> <br /> Le but du jeux étant de remplacer mon traditionnel client ftp (gftp) par quelque chose de beaucoup plus simple, monter ce ftp distant comme un simple dossier dans mon répertoire personnel...<br /> <br /> Grâce a <strong><em>Curlftpfs</em></strong>, tout cela devient possible, et en plus, avec une facilité déconcertante ! Celui ci utilise le module <strong><span style="text-decoration: underline;">Fuse</span></strong> (Filesystem in USErspace) qui permet la création de système de fichier dans l'espace utilisteur <br /> <br /> Voici la configuration pour l'exercice :<br /> <br /> <ul class="bb_ul"><li class="bb_li">Un laptop sous Ubuntu Intrepid Ibex (32bit), qui se nommera laptop dans le reste de l'article)</li></ul><br /> <br /> <ul class="bb_ul"><li class="bb_li">Un serveur ftp distant bien sur, que j'appellerai mon-ftp.fr, et partant du principe qu'il n'est pas publique, login+mdp seront nécessaires, ceux ci seront : utilisateur=util, mdp=furtif</li></ul><br /> <br /> Commençons par installer <strong><em>Curlftpfs</em></strong> (celui ci est dans les dépôts)<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> laptop@laptop:~$&nbsp;sudo&nbsp;apt-get&nbsp;install&nbsp;curlftpfs</span> </code></div><br /> <br /> Ensuite, créons le point de montage dans notre répertoire personnel, celui ci s'appellera ftp-local<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> laptop@laptop:~$&nbsp;mkdir&nbsp;&nbsp;ftp-local</span> </code></div><br /> <br /> Voila, le plus gros du boulot est fait, voyons maintenant la syntaxe à utiliser pour monter ce ftp dans notre dossier local avec <strong><em>Curlftpfs</em></strong><br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> <br />curlftpfs&nbsp;ftp://&nbsp;adresse-du-serveur-ftp&nbsp;point-de-montage&nbsp;-o&nbsp;option(s)&nbsp;à&nbsp;utiliser</span> </code></div><br /> <br /> L'option que nous devons utiliser étant donné que mon ftp n'est pas publique est l'option user, pour plus d'information sur la foultitude d'options disponible, faites un petit man curlftpfs dans votre console.<br /> Voici comment utiliser l'option user<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> user=mon-login-ftp:mon-mot-de-passe-ftp</span> </code></div><br /> <br /> Au finale, et pour le cas présent, la commande sera la suivante :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> laptop@laptop:~$&nbsp;curlftpfs&nbsp;ftp&nbsp;:&nbsp;//mon-ftp.fr&nbsp;ftp-local&nbsp;-o&nbsp;user=util:furtif</span> </code></div><br /> <p style="text-align:center">*Sans les espaces entre [url=ftp://adresse-du-serveur*]ftp://adresse-du-serveur*[/url]</p><br /> <br /> Et voila, le ftp est désormais monté dans ftp-local et je peux y travailler comme s'il s'agissait d'un dossier quelconque !<br /> mon point de montage se trouvant dans mon répertoire perso, aucun droit particulier m'est nécessaire<br /> <br /> Pour démonter le ftp, il suffit simplement de taper dans une console :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> laptop@laptop:~$&nbsp;sudo&nbsp;&nbsp;fusermount&nbsp;-u&nbsp;ftp-local</span> </code></div><br /> <br /> Et voila !<br /> <br /> Pour éviter de taper son mot de passe en clair dans la console, il suffit d'éditer, ou de créer, un fichier <strong>netrc</strong>, celui ci contiendra les infos nécessaire à la connexion ftp (adresse ftp, login+mdp), ce fichier doit se trouver dans le répertoire utilisateur et il doit bien évidement être caché.<br /> <br /> En avant !<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> laptop@laptop:~$&nbsp;vi&nbsp;&nbsp;~/.netrc</span> </code></div><br /> <br /> Ce fichier se renseigne de la manière suivante :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> machine&nbsp;ftp.mon-serveur.com&nbsp;login&nbsp;USERNAME&nbsp;password&nbsp;PASSWORD</span> </code></div><br /> <br /> Dans mon cas cela donnera :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> <br />machine&nbsp;ftp.mon-ftp.fr&nbsp;login&nbsp;util&nbsp;password&nbsp;furtif</span> </code></div><br /> <br /> Il faut restreindre l'accès a ce fichier :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> <br />laptop@laptop:~$&nbsp;sudo&nbsp;chmod&nbsp;0600&nbsp;~/.netrc</span> </code></div><br /> <br /> Maintenant, il n'est plus nécessaire d'ajouter l'option user à notre ligne de commande, il suffira simplement de dire :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> laptop@laptop:~$&nbsp;curlftpfs&nbsp;ftp&nbsp;:&nbsp;//mon-ftp.fr&nbsp;ftp-local</span> </code></div><br /> <p style="text-align:center">*Sans les espaces entre [url=ftp://adresse-du-serveur*]ftp://adresse-du-serveur*[/url]</p><br /> <br /> Avec ça, je peux maintenant monter mon ftp dans mon répertoire perso comme s'il était vraiment dedans !<br /> <br /> On peut même ajouter un petit script pour automatiser ça !<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> #!/bin/bash <br />#&nbsp;Script&nbsp;de&nbsp;montage&nbsp;de&nbsp;dossier&nbsp;ftp&nbsp;avec&nbsp;curlftpfs&nbsp;et&nbsp;fuse. <br />#&nbsp;A&nbsp;utiliser&nbsp;avec&nbsp;Nautilus,&nbsp;ou&nbsp;en&nbsp;ligne&nbsp;de&nbsp;commande&nbsp;: <br />#&nbsp;./mount_ftp&nbsp;~/dossier_de_montage <br /> <br />#Variables&nbsp;à&nbsp;modifier&nbsp;au&nbsp;besoin <br />$FTP=ftp://mon-ftp.fr <br />$LOCAL=/home/util/ftp-local <br /> <br />gksudo&nbsp;-p&nbsp;-m&nbsp;"FTP"&nbsp;|&nbsp;curlftpfs&nbsp;$FTP&nbsp;$LOCAL <br />zenity&nbsp;--info&nbsp;--text="Cliquez&nbsp;sur&nbsp;valider&nbsp;pour&nbsp;démonter" <br />fusermount&nbsp;-u&nbsp;$LOCAL</span> </code></div><br /> <p style="text-align:center">*Sans les espaces entre [url=ftp://adresse-du-serveur*]ftp://adresse-du-serveur*[/url]</p> Mon, 19 Jan 2009 17:50:01 +0100 Une webradio qui sent bon l'elektro ! http://www.tekniko.fr/cms/articles/articles-10-18+une-webradio-qui-sent-bon-l-elektro.php http://www.tekniko.fr/cms/articles/articles-10-18+une-webradio-qui-sent-bon-l-elektro.php Allez vous impr&eacute;gner de la bonne parole de Bordeaux en &eacute;coutant <a href="http://www.youkounkoun-radio.com/">Youkounkoun-radio</a> !!<br /> <br /> Vous y trouverez diff&eacute;rents styles de son ainsi que quelques tr&egrave;s bon mix <img src="../images/smileys/clap.gif" alt=":clap" class="smiley" /> <br /> <br /> <a href="http://youkounkoun-radio.com/youkounkoun-radio.m3u">YOUKOUNKOUN-RADIO</a> | <strong><a href="http://youkounkoun-radio.com/youkounkoun-radio_electro.m3u">YOUKOUNKOUN-ELECTRO</a></strong> | <strong><a href="http://youkounkoun-radio.com/youkounkoun-radio_rock.m3u">YOUKOUNKOUN-ROCK</a></strong><br /> <br /> <span style="text-decoration: underline;">Voici le panel de flux actuel</span> :<br /> <br /> Live : <a href="http://youkounkoun-radio.com/youkounkoun-radio.m3u">http://youkounkoun-radio.com/youkounkoun-radio.m3u</a><br /> Electro : <a href="http://youkounkoun-radio.com/youkounkoun-radio_electro.m3u">http://youkounkoun-radio.com/youkounkoun-radio_electro.m3u</a><br /> Rock : <a href="http://youkounkoun-radio.com/youkounkoun-radio_rock.m3u">http://youkounkoun-radio.com/youkounkoun-radio_rock.m3u</a> Mon, 01 Dec 2008 19:07:01 +0100 Chiffrer un répertoire avec encfs... http://www.tekniko.fr/cms/articles/articles-2-9+chiffrer-un-repertoire-avec-encfs.php http://www.tekniko.fr/cms/articles/articles-2-9+chiffrer-un-repertoire-avec-encfs.php Grâce a l'application ENCFS, vous allez pouvoir chiffrer toutes les données que vous voulez ! Le principe est simple, il y a deux répertoires, un en clair et un chiffré, on fait ce que l'on veut dans le clair et des lors qu'on le ferme, toutes ces données sont chiffrées et enfermées dans le répertoire chiffré, simple non ??<br /> <br /> Les applications nécessaire à la réalisation de ce projet sont les suivantes :<br /> <br /> * Encfs<br /> <br /> * Fuse-utils<br /> <br /> * Module-assistant<br /> <br /> <br /> <br /> Pour ce billet, j'ai fait mes test avec une Dapper version serveur, le nom de machine est virtual, et l'utilisateur virtual, les dossiers seront les suivant :<br /> <br /> * Dossier en clair : libre<br /> <br /> * Dossier chiffré : .prison<br /> <br /> <br /> <br /> Commençons par installer ce qu'il faut, a savoir encfs et fuse-utils :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;sudo&nbsp;apt-get&nbsp;install&nbsp;encfs&nbsp;fuse-utils</span> </code></div><br /> <br /> <br /> quelques librairies seront installées en plus de ces deux paquets. Il faut ensuite rajouter le module fuse au fichier modules, qui se trouve dans le répertoire /etc (pour les incultes !), afin que celui ci soit pris en compte au démarrage, deux manières, soit on édite ce fichier manuellement, soit on le rajoute via une simple ligne de commande, étant feignant à la base, j'opte pour la deuxième solution !<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;sudo&nbsp;sh&nbsp;-c&nbsp;"echo&nbsp;fuse&nbsp;&gt;&gt;&nbsp;/etc/modules"</span> </code></div><br /> <br /> <br /> ceci fait, on charge le module a l'aide de modprobe :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;sudo&nbsp;modprobe&nbsp;fuse</span> </code></div><br /> <br /> <br /> Jusqu'ici tout vas bien, collons nous dans le groupe de fuse, histoire de ne pas être un inconnue a ces yeux !<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;sudo&nbsp;adduser&nbsp;virtual&nbsp;fuse</span> </code></div><br /> <br /> <br /> Vérifions que c'est bon :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;grep&nbsp;"fuse"&nbsp;"/etc/group" <br />fuse:x:113:virtual</span> </code></div><br /> <br /> <br /> Pour le 113, cela peut varier, ne vous inquiétez pas si ce n'est pas identique !<br /> Bon, on viens de dégrossir la base, pour vérifier que nous sommes bien connu du groupe fuse, la commande "groups" dans un terminal pourra nous le confirmer. Passons au plus intéressant, la création des répertoires !!!<br /> Je rappel que le répertoire clair se nomme "libre" et que celui qui sera chiffré s' appel ".prison, nous allons utiliser la commande encfs, qui ne nécessite pas de privilège root, et qui, demande des chemins complets derrière elle.<br /> créons ces répertoire dans le home :<br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> <br />virtual@virtual-desktop:~$&nbsp;encfs&nbsp;/home/virtual/.prison&nbsp;/home/virtual/libre</span> </code></div><br /> <br /> <br /> Une foultitude de petites questions s'en suivent, est ce qu'il faut créer ces répertoire qui n'existe pas encore ? oui, choisir une option (ou un mode) moi je le laisse vide pour avoir un mode normal<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;encfs&nbsp;/home/virtual/.prison&nbsp;/home/virtual/libre <br />Le&nbsp;répertoire&nbsp;"/home/virtual/.prison/"&nbsp;n'existe&nbsp;pas.&nbsp;Faut-il&nbsp;le&nbsp;créer&nbsp;?&nbsp;(y/n)&nbsp;y <br />Le&nbsp;répertoire&nbsp;"/home/virtual/libre"&nbsp;n'existe&nbsp;pas.&nbsp;Faut-il&nbsp;le&nbsp;créer&nbsp;?&nbsp;(y/n)&nbsp;y <br />Création&nbsp;du&nbsp;nouveau&nbsp;volume&nbsp;encrypté. <br />Veuillez&nbsp;choisir&nbsp;l'une&nbsp;des&nbsp;options&nbsp;suivantes&nbsp;: <br />&nbsp;entrez&nbsp;"x"&nbsp;pour&nbsp;le&nbsp;mode&nbsp;de&nbsp;configuration&nbsp;expert, <br />&nbsp;entrez&nbsp;"p"&nbsp;pour&nbsp;le&nbsp;mode&nbsp;paranoïaque&nbsp;préconfiguré, <br />&nbsp;toute&nbsp;autre&nbsp;entrée&nbsp;ou&nbsp;une&nbsp;ligne&nbsp;vide&nbsp;sélectionnera&nbsp;le&nbsp;mode&nbsp;normal. <br /> <br /> <br /> <br />Configuration&nbsp;normale&nbsp;sélectionnée. <br /> <br />Configuration&nbsp;terminée.&nbsp;Le&nbsp;système&nbsp;de&nbsp;fichier&nbsp;à&nbsp;créer&nbsp;a&nbsp;les&nbsp;propriétés&nbsp;suivantes&nbsp;: <br />Chiffrement&nbsp;de&nbsp;système&nbsp;de&nbsp;fichiers&nbsp;"ssl/blowfish",&nbsp;version&nbsp;2:1:1 <br />Encodage&nbsp;de&nbsp;fichier&nbsp;"nameio/block",&nbsp;version&nbsp;3:0:1 <br />Taille&nbsp;de&nbsp;clé&nbsp;:&nbsp;160&nbsp;bits <br />Taille&nbsp;de&nbsp;bloc&nbsp;:&nbsp;512&nbsp;octets <br />Chaque&nbsp;fichier&nbsp;contient&nbsp;un&nbsp;en-tête&nbsp;de&nbsp;8&nbsp;octets&nbsp;avec&nbsp;des&nbsp;données&nbsp;IV&nbsp;uniques. <br />Noms&nbsp;de&nbsp;fichier&nbsp;encodés&nbsp;à&nbsp;l'aide&nbsp;du&nbsp;mode&nbsp;de&nbsp;chaînage&nbsp;IV. <br /></span> </code></div><br /> <br /> Ensuite, entrer le mot de passe qui permettra de déverrouiller ces répertoires, il peut être différent du mot de passe de session, et c'est même mieux, si l'on veut pousser sur la sécurité !<br /> <br /> Vous devez entrer un mot de passe pour votre système de fichiers.<br /> Vous devez vous en souvenir, car il n'existe aucun mécanisme de récupération.<br /> Toutefois, le mot de passe peut être changé plus tard à l'aide d'encfsctl.<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> Nouveau&nbsp;mot&nbsp;de&nbsp;passe&nbsp;: <br />Vérifier&nbsp;le&nbsp;mot&nbsp;de&nbsp;passe&nbsp;:</span> </code></div><br /> <br /> <br /> On peut vérifier que ces répertoires sont bien monter avec un petit "cat" :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;cat&nbsp;/proc/mounts <br />rootfs&nbsp;/&nbsp;rootfs&nbsp;rw&nbsp;0&nbsp;0 <br />none&nbsp;/sys&nbsp;sysfs&nbsp;rw&nbsp;0&nbsp;0 <br />none&nbsp;/proc&nbsp;proc&nbsp;rw,nodiratime&nbsp;0&nbsp;0 <br />udev&nbsp;/dev&nbsp;tmpfs&nbsp;rw&nbsp;0&nbsp;0 <br />/dev/hda1&nbsp;/&nbsp;ext3&nbsp;rw,data=ordered&nbsp;0&nbsp;0 <br />/dev/hda1&nbsp;/dev/.static/dev&nbsp;ext3&nbsp;rw,data=ordered&nbsp;0&nbsp;0 <br />tmpfs&nbsp;/var/run&nbsp;tmpfs&nbsp;rw&nbsp;0&nbsp;0 <br />tmpfs&nbsp;/var/lock&nbsp;tmpfs&nbsp;rw&nbsp;0&nbsp;0 <br />tmpfs&nbsp;/lib/modules/2.6.15-51-386/volatile&nbsp;tmpfs&nbsp;rw&nbsp;0&nbsp;0 <br />devpts&nbsp;/dev/pts&nbsp;devpts&nbsp;rw&nbsp;0&nbsp;0 <br />tmpfs&nbsp;/dev/shm&nbsp;tmpfs&nbsp;rw&nbsp;0&nbsp;0 <br />tmpfs&nbsp;/var/run&nbsp;tmpfs&nbsp;rw&nbsp;0&nbsp;0 <br />tmpfs&nbsp;/var/lock&nbsp;tmpfs&nbsp;rw&nbsp;0&nbsp;0 <br />encfs&nbsp;/home/virtual/libre&nbsp;fuse&nbsp;rw,nosuid,nodev,user_id=1000,group_id=1000,default_permissions&nbsp;0&nbsp;0</span> </code></div><br /> <br /> <br /> Heyyy, que vois-je a la fin ?? pas de soucis, c'est monté !<br /> <br /> Bon bah ça y est, il n'y a plus qu'a s'en servir ! Pour cela, il y a deux modes : on et off<br /> En gros, on monte ces répertoire pour y travailler, y placer ces données, et on les démonte une fois finit, ce qui vas automatiquement chiffrer les données du répertoire libre dans le répertoire .prison. C'est simplement une histoire de mount...ou plutôt de fusermount !<br /> On monte avec encfs et on démonte avec fusermount (fusermount ne sera pas un inconnu pour celles et ceux qui on lu mon billet sur sshfs...).<br /> Pour monter ces répertoire, on vas utiliser la même commande que pour les créer, sauf que cette fois, la commande vas monter et pas créer, c'est simple !<br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> <br />virtual@virtual-desktop:~$&nbsp;encfs&nbsp;/home/virtual/.prison&nbsp;/home/virtual/libre</span> </code></div><br /> <br /> <br /> Hop, is good, c'est monté....Et non !!! misère que se passe t'il ?? tout allé si bien ! Et pourtant sa me renvoi ça dans la console :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> fusermount:&nbsp;failed&nbsp;to&nbsp;access&nbsp;mountpoint&nbsp;/home/virtual/libre:&nbsp;Permission&nbsp;denied <br />Erreur&nbsp;de&nbsp;fuse.&nbsp;Problèmes&nbsp;courants&nbsp;: <br />&nbsp;-&nbsp;module&nbsp;noyau&nbsp;fuse&nbsp;non&nbsp;installé&nbsp;(faites&nbsp;"modprobe&nbsp;fuse") <br />&nbsp;-&nbsp;options&nbsp;invalides&nbsp;--&nbsp;voir&nbsp;le&nbsp;message&nbsp;d'utilisation <br /></span> </code></div><br /> en fait, il s'agit du module fuse qui n'est pas vraiment bien chargé, c'est la que module-assistant intervient pour corriger cela, installons le et lançons le !<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;sudo&nbsp;apt-get&nbsp;install&nbsp;module-assistant</span> </code></div><br /> <br /> Pour le lancer, il suffit de l'appeler dans la console, ensuite vient un écran avec toutes une série de choix, il faut les faire dans l'ordre suivant :<br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> PREPARE&nbsp;&nbsp;Configurer&nbsp;le&nbsp;système&nbsp;pour&nbsp;compiler&nbsp;des&nbsp;modules <br />SELECT&nbsp;&nbsp;&nbsp;Sélectionner&nbsp;le&nbsp;module&nbsp;ou&nbsp;le&nbsp;paquet&nbsp;source&nbsp;à&nbsp;traiter <br />[*]&nbsp;fuse&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filesystem&nbsp;in&nbsp;USErspace <br />BUILD&nbsp;&nbsp;&nbsp;Compiler&nbsp;les&nbsp;paquets&nbsp;de&nbsp;modules&nbsp;pour&nbsp;le&nbsp;noyau&nbsp;actif <br />INSTALL&nbsp;Installer&nbsp;les&nbsp;paquets&nbsp;pour&nbsp;le&nbsp;noyau&nbsp;actif&nbsp; <br />EXIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quitter&nbsp;le&nbsp;programme</span> </code></div><br /> <br /> Et voili voilou ! A partir de la, vous pouvez monter vos répertoires avec cette commande :<br /> <strong><p style="text-align:left"><br /> ++Sous Ubuntu 8.04 Hardy, cette opération n'est pas nécessaire, relancez seulement la sessions++</p></strong><br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;encfs&nbsp;/home/virtual/.prison&nbsp;/home/virtual/libre</span> </code></div><br /> <br /> <br /> Et pour les démonter, comme ceci :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;fusermount&nbsp;-u&nbsp;/home/virtual/libre/</span> </code></div><br /> <br /> <br /> Et c'est a ce moment la que les données que vous avez placés dans le répertoire libre seront chiffrées dans le répertoire .prison !<br /> Pour ce qui est d'automatiser ça, c'est très simple, vous pouvez créer deux commandes, le première s'appellera decrypt (pour monter et ouvrir les répertoires) et la deuxième encrypt pour refermer et démonter le tout.<br /> Créons ces commandes, qui se trouverons avec les autres dans le répertoire /usr/bin :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;sudo&nbsp;vi&nbsp;/usr/bin/decrypt</span> </code></div><br /> <br /> <br /> A l'intérieur de ce fichier, collez le texte suivant :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> #!/bin/sh <br />encfs&nbsp;/home/virtual/.prison/&nbsp;/home/virtual/libre/</span> </code></div><br /> <br /> <br /> Puis la deuxième :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;sudo&nbsp;vi&nbsp;/usr/bin/encrypt</span> </code></div><br /> <br /> <br /> Même châtiment :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> #!/bin/sh <br />fusermount&nbsp;-u&nbsp;/home/virtual/libre <br /></span> </code></div><br /> <br /> Donnons les droits qui vont bien a ces commandes :<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> virtual@virtual-desktop:~$&nbsp;sudo&nbsp;chown&nbsp;virtual&nbsp;/usr/bin/decrypt&nbsp;/usr/bin/encrypt <br />virtual@virtual-desktop:~$&nbsp;chmod&nbsp;755&nbsp;/usr/bin/encrypt&nbsp;/usr/bin/decrypt <br /></span> </code></div><br /> <br /> Voila, maintenant il suffit de taper "decrypt" dans la console pour avoir accès a ces données en clair, puis de fermer avec la commande "encrypt".<br /> Je vous laisse imaginer ce que l'on pourrait faire de cette application en milieu professionnel ou certaines données doivent rester confidentiel...<br /> <br /> ATTENTION : Souvenez vous bien du mot de passe attribué a ces dossier car il n'existe pas de procédure pour les récupérer en cas de perte !<br /> <br /> Voici un petit script qui vous permettra de monter/démonter vos données très simplement et de manière graphique, il vous faudra juste modifier les variables et l'enregistrer dans le dossier /home/utilisateur/.gnome2/nautilus-scripts<br /> <br /> <span class="text_code">Code :</span><div class="code"><code><span style="color: #000000"> <br />#!/bin/bash <br />#&nbsp;Script&nbsp;de&nbsp;montage&nbsp;de&nbsp;dossier&nbsp;crypté&nbsp;avec&nbsp;encfs&nbsp;et&nbsp;fuse. <br />#&nbsp;A&nbsp;utiliser&nbsp;avec&nbsp;Nautilus,&nbsp;ou&nbsp;en&nbsp;ligne&nbsp;de&nbsp;commande&nbsp;: <br />#&nbsp;./mount_enc&nbsp;~/dossier_de_montage <br /> <br />#&nbsp;Variables&nbsp;à&nbsp;modifier&nbsp;:&nbsp;repertoire&nbsp;contenant&nbsp;les&nbsp;fichiers&nbsp;non&nbsp;cryptés&nbsp;et&nbsp;cryptés <br />OPENFOLDER=/home/virtual/libre <br />CRYPTEDFOLDER=/home/virtual/.prison <br /> <br /> <br />gksudo&nbsp;-p&nbsp;-m&nbsp;"Top&nbsp;Secret"&nbsp;|&nbsp;encfs&nbsp;&nbsp;$CRYPTEDFOLDER&nbsp;$OPENFOLDER&nbsp; <br />zenity&nbsp;--info&nbsp;--text="Cliquez&nbsp;sur&nbsp;valider&nbsp;pour&nbsp;démonter" <br />fusermount&nbsp;-u&nbsp;$OPENFOLDER</span> </code></div><br /> <br /> Une fois enregistré, pensez a lui donner les droit d'exécution (chmod 755), il sera désormais accessible via un clic droit sur le mulot, rien n'empêche même de se créer un lanceur perso. <br /> <br /> <br /> SOURCES :<br /> <br /> <a href="http://doc.ubuntu-fr.org/encfs"> * Ce tuto sur Ubuntu-fr, dont je me suis plus que largement inspiré...</a><br /> <br /> <a href="http://arg0.net/wiki/encfs"> * Le site Encfs</a> Sun, 09 Nov 2008 16:09:01 +0100 Plan du site http://www.tekniko.fr/cms/articles/articles-10-31+plan-du-site.php http://www.tekniko.fr/cms/articles/articles-10-31+plan-du-site.php <p style="text-align:center">Le site est compos&eacute; de huit cat&eacute;gories principales, certaines d'entre elles se divisent en sous cat&eacute;gories.<br /> <br /> <br /> <br /> <strong><span style="font-size: 25px;"><span style="color:red;">Cat&eacute;gorie Infos</span></span></strong><br /> <br /> <a href="http://www.tekniko.fr/cms/articles/articles-10.php">Vous y trouverez des informations diverses et vari&eacute;es (samples, h&eacute;bergement...)</a><br /> <br /> <br /> <strong>&lt;&lt;&lt;===|===&gt;&gt;&gt;</strong><br /> <br /> <br /> <strong><span style="font-size: 25px;"><span style="color:red;">Cat&eacute;gorie Muzik</span></span></strong> <br /> (compos&eacute;e de trois sous cat&eacute;gories)<br /> <br /> <strong><ul class="bb_ul"><li class="bb_li"><span style="font-size: 20px;">Avis sur les mix</span></li></ul></strong><br /> <a href="http://www.tekniko.fr/cms/articles/articles-3+download-mix.php">Ici, vous pouvez laisser vos impressions sur les mix en t&eacute;l&eacute;chargement.</a><br /> <br /> <strong><ul class="bb_ul"><li class="bb_li"><span style="font-size: 20px;">Festivit&eacute;s</span></li></ul></strong><br /> <a href="http://www.tekniko.fr/cms/articles/articles-4+festivites.php">Dans cette section, vous trouverez des &quot;reportages&quot; sur nos soir&eacute;es.</a><br /> <br /> <strong><ul class="bb_ul"><li class="bb_li"><span style="font-size: 20px;">Playlists</span></li></ul></strong><br /> <a href="http://www.tekniko.fr/cms/articles/articles-11+playlist.php">Comme son nom l'indique, vous trouverez ici quelques playlists, il faut &ecirc;tre membre pour y acc&eacute;der.</a><br /> <br /> <br /> <strong>&lt;&lt;&lt;===|===&gt;&gt;&gt;</strong><br /> <br /> <br /> <strong><span style="font-size: 25px;"><span style="color:red;">Cat&eacute;gorie Linux</span> </span></strong><br /> <br /> <a href="http://www.tekniko.fr/cms/articles/articles-2+linux.php">Cette cat&eacute;gorie regroupe des tutoriels pour Linux Ubuntu (chiffrage r&eacute;pertoire, mise en place d'une webradio...)</a><br /> <br /> <br /> <strong>&lt;&lt;&lt;===|===&gt;&gt;&gt;</strong><br /> <br /> <br /> <strong><span style="font-size: 25px;"><span style="color:red;">Cat&eacute;gorie Cot&eacute; perso </span></span></strong><br /> <br /> <a href="http://www.tekniko.fr/cms/articles/articles-9+cote-perso.php">Des truc que j'ai v&eacute;cu.</a><br /> <br /> <br /> <strong>&lt;&lt;&lt;===|===&gt;&gt;&gt;</strong><br /> <br /> <br /> <strong><span style="font-size: 25px;"><span style="color:red;">Livre d'Or </span></span></strong><br /> <br /> <a href="http://www.tekniko.fr/cms/guestbook/guestbook.php">Pour laisser des commentaires sur le site en g&eacute;n&eacute;ral.</a><br /> <br /> <br /> <strong>&lt;&lt;&lt;===|===&gt;&gt;&gt;</strong><br /> <br /> <br /> <strong><span style="font-size: 25px;"><span style="color:red;">Galerie</span></span></strong><br /> <br /> <a href="http://www.tekniko.fr/cms/gallery/gallery.php">Retrouvez les albums photos li&eacute;s &agrave; certains articles.</a><br /> <br /> <br /> <strong>&lt;&lt;&lt;===|===&gt;&gt;&gt;</strong><br /> <br /> <br /> <strong><span style="font-size: 25px;"><span style="color:red;">T&eacute;l&eacute;chargements</span></span></strong><br /> <br /> <a href="http://www.tekniko.fr/cms/download/download.php">Dans cette section se trouve nos mix a prendre.</a><br /> <br /> <br /> <strong>&lt;&lt;&lt;===|===&gt;&gt;&gt;</strong><br /> <br /> <br /> <strong><span style="font-size: 25px;"><span style="color:red;">Liens</span></span></strong><br /> <br /> <a href="http://www.tekniko.fr/cms/web/web.php">Les liens vers nos Myspace respectif, ainsi que d'autres pour des webzines, forum et autre...</a></p> Tue, 28 Oct 2008 16:00:03 +0100 **Mox aka Funny Dead Things** http://www.tekniko.fr/cms/articles/articles-10-27+mox-aka-funny-dead-things.php http://www.tekniko.fr/cms/articles/articles-10-27+mox-aka-funny-dead-things.php <p style="text-align:center"><strong>**Mox aka Funny Dead Things**</strong></p><br /> <p style="text-align:center"><img src="http://www.tekniko.fr/dotclear2/images/dj/Mox.TN__.jpg" alt="" /></p><br /> <strong><p style="text-align:center">**Nasci Pati Mori EP**</p></strong><br /> <p style="text-align:center">Out now on <strong>Juno download</strong> and <strong>Beatdigital...</strong></p><br /> <br /> <p style="text-align:center"><a href="http://www.msplinks.com/MDFodHRwOi8vd3d3LmJlYXRzZGlnaXRhbC5jb20vYXJ0aXN0LzEwNDExNT9hY3Rpb249dmlldyZjdXJyZW50PWxvZ28uanBn?action=view&amp;current=nasci-1.jpg&quot; target="><img src="http://i73.photobucket.com/albums/i213/moxunder/nasci-1.jpg" alt="" /></a></p><br /> <br /> <p style="text-align:center">*Click on Artwork for download*</p><br /> <br /> <p style="text-align:center"><a href="http://www.juno.co.uk/ppps/products/1357130-02.htm"><img src="http://i73.photobucket.com/albums/i213/moxunder/juno_logo.jpg" alt="" /></a></p><br /> <p style="text-align:center"><a href="http://www.msplinks.com/MDFodHRwOi8vd3d3LmJlYXRzZGlnaXRhbC5jb20vYXJ0aXN0LzEwNDExNT9hY3Rpb249dmlldyZjdXJyZW50PWxvZ28uanBn?action=view&amp;current=logo.jpg"><img src="http://i73.photobucket.com/albums/i213/moxunder/logo.jpg" alt="" /></a></p> Wed, 15 Oct 2008 18:46:52 +0200