<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Anthor.Net &#187; Debian</title>
	<atom:link href="http://www.anthor.net/blog/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anthor.net</link>
	<description></description>
	<lastBuildDate>Mon, 05 Dec 2011 16:29:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Serveur Dédié Debian Etch 64bit chez OVH &#8211; Mise à jour de rkhunter 1.3.2</title>
		<link>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-mise-a-jour-de-rkhunter-1-3-2/</link>
		<comments>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-mise-a-jour-de-rkhunter-1-3-2/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 19:00:04 +0000</pubDate>
		<dc:creator>Anthor</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.anthor.net/?p=371</guid>
		<description><![CDATA[La dernière version de rkhunter n&#8217;étant pas encore disponible dans les paquets Debian, on peux l&#8217;installer manuellement. wget http://downloads.sourceforge.net/rkhunter/rkhunter-1.3.2.tar.gz?modtime=1204134588&#38;amp;big_mirror=0 tar zxvf rkhunter-1.3.2.tar.gz cd rkhunter-1.3.2/ sh installer.sh --layout default --install Éditer /etc/rkhunter.conf # Use a custom directory for shared scripts SHAREDIR=/usr/share &#160; #Script whitelist to add SCRIPTWHITELIST=/bin/egrep SCRIPTWHITELIST=/bin/fgrep SCRIPTWHITELIST=/bin/which SCRIPTWHITELIST=/usr/bin/groups SCRIPTWHITELIST=/usr/bin/ldd SCRIPTWHITELIST=/usr/bin/lwp-request SCRIPTWHITELIST=/usr/sbin/adduser &#160; # Allow [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.anthor.net/wp-content/uploads/2008/11/logo-rootkit.gif" alt="" title="" width="125" height="133" class="alignleft size-full wp-image-374" /><br />
La dernière version de rkhunter n&#8217;étant pas encore disponible dans les paquets Debian, on peux l&#8217;installer manuellement.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>rkhunter<span style="color: #000000; font-weight: bold;">/</span>rkhunter-1.3.2.tar.gz?<span style="color: #007800;">modtime</span>=<span style="color: #000000;">1204134588</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">big_mirror</span>=<span style="color: #000000;">0</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf rkhunter-1.3.2.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> rkhunter-1.3.2<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sh</span> installer.sh <span style="color: #660033;">--layout</span> default <span style="color: #660033;">--install</span></pre></div></div>

<p><span id="more-371"></span><br />
Éditer /etc/rkhunter.conf</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Use a custom directory for shared scripts</span>
<span style="color: #007800;">SHAREDIR</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share
&nbsp;
<span style="color: #666666; font-style: italic;">#Script whitelist to add</span>
<span style="color: #007800;">SCRIPTWHITELIST</span>=<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">egrep</span>
<span style="color: #007800;">SCRIPTWHITELIST</span>=<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">fgrep</span>
<span style="color: #007800;">SCRIPTWHITELIST</span>=<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">which</span>
<span style="color: #007800;">SCRIPTWHITELIST</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">groups</span>
<span style="color: #007800;">SCRIPTWHITELIST</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">ldd</span>
<span style="color: #007800;">SCRIPTWHITELIST</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lwp-request
<span style="color: #007800;">SCRIPTWHITELIST</span>=<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>adduser
&nbsp;
<span style="color: #666666; font-style: italic;"># Allow hidden dir</span>
<span style="color: #007800;">ALLOWHIDDENDIR</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>.udev
<span style="color: #007800;">ALLOWHIDDENDIR</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>.static</pre></div></div>

<p>J&#8217;ai également supprimé le CRON Job, pour ne recevoir un email qu&#8217;en cas d&#8217;erreur.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-mise-a-jour-de-rkhunter-1-3-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Serveur Dédié Debian Etch 64bit chez OVH &#8211; Installation de Postfix</title>
		<link>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-de-postfix/</link>
		<comments>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-de-postfix/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 11:15:09 +0000</pubDate>
		<dc:creator>Anthor</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.anthor.net/?p=343</guid>
		<description><![CDATA[Installez postfix : apt-get install postfix Choisissez Site Internet et remplir votre FQDN. Testez que le serveur fonctionne : echo &#34;test&#34; &#124; mail -s testsubject someemail@hotmailorwherever.com Rien à faire de plus pour le moment, c&#8217;est juste pour recevoir les rapports.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.anthor.net/wp-content/uploads/2008/10/logo-postfix.gif" alt="" title="" width="130" height="91" class="alignleft size-full wp-image-345" /><br />
Installez postfix :</p>

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

<p>Choisissez Site Internet et remplir votre FQDN.</p>
<p>Testez que le serveur fonctionne :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;test&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> testsubject someemail<span style="color: #000000; font-weight: bold;">@</span>hotmailorwherever.com</pre></div></div>

<p>Rien à faire de plus pour le moment, c&#8217;est juste pour recevoir les rapports.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-de-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serveur Dédié Debian Etch 64bit chez OVH &#8211; Installation d&#8217;Apache 2, PHP5, et phpMyAdmin</title>
		<link>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-dapache-2-php5-et-phpmyadmin/</link>
		<comments>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-dapache-2-php5-et-phpmyadmin/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 09:30:34 +0000</pubDate>
		<dc:creator>Anthor</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.anthor.net/?p=337</guid>
		<description><![CDATA[Pour installer Apache 2 : apt-get install apache2 apache2-mpm-prefork apache2-utils apache2-prefork-dev Puis installer PHP 5 : apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-mhash php5-mysql Éditer le fichier /etc/apache2/ports.conf et ajouter la ligne : Listen 443 Effectuez les commandes suivantes pour activer les modules SSL, Rewrite, Suexec et Include [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.anthor.net/wp-content/uploads/2008/10/fab.os_.logo_.apache.200.150.jpg" alt="" title="" width="200" height="150" class="alignleft size-full wp-image-339" /><br />
Pour installer Apache 2 :</p>

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

<p>Puis installer PHP 5 :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-mhash php5-mysql</pre></div></div>

<p><span id="more-337"></span><br />
Éditer le fichier /etc/apache2/ports.conf et ajouter la ligne :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Listen <span style="color: #000000;">443</span></pre></div></div>

<p>Effectuez les commandes suivantes pour activer les modules SSL, Rewrite, Suexec et Include :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2enmod ssl
a2enmod rewrite
a2enmod suexec
a2enmod include</pre></div></div>

<p>Je souhaite maintenant mettre en place les extensions PECL_HTTP, Fileinfo et APC op cache.<br />
Pour préparer leur installation, j&#8217;ai besoin de quelques outils supplémentaires :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> curl libcurl3-gnutls-dev libmagic-dev
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apxs2 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apxs
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>file<span style="color: #000000; font-weight: bold;">/</span>magic <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>magic.mime</pre></div></div>

<p>Puis je compile les extensions :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pecl <span style="color: #c20cb9; font-weight: bold;">install</span> pecl_http
pecl <span style="color: #c20cb9; font-weight: bold;">install</span> fileinfo
pecl <span style="color: #c20cb9; font-weight: bold;">install</span> apc</pre></div></div>

<p>Pour activer les extensions et effectuer quelques configurations, j&#8217;édite le fichier /etc/php5/apache2/php.ini :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">expose_php = On
magic_quotes_gpc = Off
default_charset = <span style="color: #ff0000;">&quot;utf-8&quot;</span>
allow_url_include = On
extension = http.so
extension = fileinfo.so
extension = apc.so</pre></div></div>

<p>Installer phpMyAdmin :</p>

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

<p>Et enfin redémarrer Apache <img src='http://www.anthor.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><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 restart</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-dapache-2-php5-et-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Serveur Dédié Debian Etch 64bit chez OVH &#8211; Installation du serveur FTP : proftpd</title>
		<link>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-du-serveur-ftp-proftpd/</link>
		<comments>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-du-serveur-ftp-proftpd/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 23:30:08 +0000</pubDate>
		<dc:creator>Anthor</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.anthor.net/?p=330</guid>
		<description><![CDATA[Pour installer proftpd : apt-get install proftpd openssl Sélectionner l&#8217;option de serveur indépendant. Comme votre serveur n&#8217;est pas en IPv6, le service ne démarrera pas, cela est normal. Pour corriger ce problème, éditez le fichier /etc/proftpd/proftpd.conf, modifiez la première ligne, et ajouter les 3 lignes suivantes : UseIPv6 off DefaultRoot ~ IdentLookups off ServerIdent on [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.anthor.net/wp-content/uploads/2008/10/proftpd.png" alt="" title="" width="215" height="92" class="alignleft size-full wp-image-333" /><br />
Pour installer proftpd :</p>

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

<p><span id="more-330"></span></p>
<p>Sélectionner l&#8217;option de serveur indépendant. Comme votre serveur n&#8217;est pas en IPv6, le service ne démarrera pas, cela est normal.</p>
<p>Pour corriger ce problème, éditez le fichier <strong>/etc/proftpd/proftpd.conf</strong>, modifiez la première ligne, et ajouter les 3 lignes suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">UseIPv6 off
DefaultRoot ~
IdentLookups off
ServerIdent on <span style="color: #ff0000;">&quot;FTP Server Ready&quot;</span></pre></div></div>

<p>Créez le répertoire destiné à contenir le certificat, et générez le certificat :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>proftpd<span style="color: #000000; font-weight: bold;">/</span>ssl
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-out</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>proftpd<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>proftpd.cert.pem <span style="color: #660033;">-keyout</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>proftpd<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>proftpd.key.pem</pre></div></div>

<p>Éditez le fichier /etc/proftpd/proftpd.conf :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">TLSEngine                  on
TLSLog                     <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>proftpd<span style="color: #000000; font-weight: bold;">/</span>tls.log
TLSProtocol                SSLv23
TLSOptions                 NoCertRequest
TLSRSACertificateFile      <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>proftpd<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>proftpd.cert.pem
TLSRSACertificateKeyFile   <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>proftpd<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>proftpd.key.pem
TLSVerifyClient            off
TLSRequired                on</pre></div></div>

<p>Et redémarrer proftpd :</p>

<div class="wp_syntax"><div class="code"><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>proftpd restart</pre></div></div>

<p>Vous ne pouvez plus vous connecter en FTP standard, mais vous connecter en FTP avec le support explicit du TLS/SSL ( Auth TLS &#8211; Explicit ), si vous voulez laisser la possibilité de se connecter en ftp standard, mettez TLSRequired à off.</p>
<p>Comme nous avons précédemment mis en place fail2ban, nous modifions le fichier <strong>/etc/fail2ban/jail.local</strong> pour modifier la section proftpd et activer son support sous fail2ban :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>proftpd<span style="color: #7a0874; font-weight: bold;">&#93;</span>
enabled  = <span style="color: #c20cb9; font-weight: bold;">true</span>
port     = <span style="color: #c20cb9; font-weight: bold;">ftp</span>
filter   = proftpd
logpath  = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>auth.log
failregex = proftpd: <span style="color: #7a0874; font-weight: bold;">&#40;</span>pam_unix<span style="color: #7a0874; font-weight: bold;">&#41;</span> authentication failure; .<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #007800;">rhost</span>=
maxretry = <span style="color: #000000;">5</span></pre></div></div>

<p>Et redémarrez fail2ban :</p>

<div class="wp_syntax"><div class="code"><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>fail2ban restart</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-du-serveur-ftp-proftpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serveur Dédié Debian Etch 64bit chez OVH &#8211; Installation du serveur MySQL</title>
		<link>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-du-serveur-mysql/</link>
		<comments>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-du-serveur-mysql/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 17:00:39 +0000</pubDate>
		<dc:creator>Anthor</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.anthor.net/?p=324</guid>
		<description><![CDATA[Rien de bien compliqué à cette étape ! Installation, sécurisation et localisation en UTF8, ça évitera notamment de futurs problèmes d&#8217;affichage avec phpmyadmin&#8230; L&#8217;installation : apt-get install mysql-server mysql-client libmysqlclient15-dev Une fois l&#8217;installation terminée la sécurisation est elle aussi des plus simple : mysql_secure_installation Répondez aux questions avec la réponse par défaut. Pensez à bien [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.anthor.net/wp-content/uploads/2008/10/Mysql.gif" alt="" title="" width="100" height="52" class="alignleft size-full wp-image-326" /><br />
Rien de bien compliqué à cette étape ! Installation, sécurisation et localisation en UTF8, ça évitera notamment de futurs problèmes d&#8217;affichage avec phpmyadmin&#8230;</p>
<p><span id="more-324"></span></p>
<p>L&#8217;installation :</p>

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

<p>Une fois l&#8217;installation terminée la sécurisation est elle aussi des plus simple :</p>

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

<p>Répondez aux questions avec la réponse par défaut. Pensez à bien noter votre mot de passe root, ce mot de passe est différent de l&#8217;utilisateur root, il ne sert qu&#8217;au serveur mySQL.</p>
<p>Pour que votre serveur tourne par défaut en utf8, éditer le fichier /etc/mysql/my.cnf :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>mysqld<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># * Basic Settings</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #007800;">collation_server</span>=utf8_general_ci
<span style="color: #007800;">character_set_server</span>=utf8
default-character-set=utf8
<span style="color: #007800;">init_connect</span>=<span style="color: #ff0000;">'SET collation_connection = utf8_general_ci'</span>
<span style="color: #007800;">init_connect</span>=<span style="color: #ff0000;">'SET NAMES utf8'</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>mysql<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #666666; font-style: italic;">#no-auto-rehash # faster start of mysql but no tab completition</span>
default-character-set=utf8</pre></div></div>

<p>En ajoutant ces deux lignes vous vous assurez de ne pas avoir de double conversion des caractères dans phpmyadmin, et d&#8217;avoir l&#8217;utf8 en encodage par défaut.</p>
<p>Dernière étape, redémarrer le service :</p>

<div class="wp_syntax"><div class="code"><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>mysql restart</pre></div></div>

<p>Nous installerons phpmyadmin en temps voulu, après Apache et PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-du-serveur-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serveur Dédié Debian Etch 64bit chez OVH &#8211; Protection contre les rootkits</title>
		<link>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-protection-contre-les-rootkits/</link>
		<comments>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-protection-contre-les-rootkits/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 16:10:26 +0000</pubDate>
		<dc:creator>Anthor</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.anthor.net/?p=313</guid>
		<description><![CDATA[Ils existent deux services permettant de détecter d&#8217;éventuels rootkits sur votre serveur : chkrootkit rkhunter Commençons par les installer : apt-get install chkrootkit rkhunter libmd5-perl Configuration de RKHunter suivant votre système, ce script modifie des dossier cachés de Débian pour qu&#8217;il soit ignorés de rkhunter et modifie la directive du login root suivant la configuration. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.anthor.net/wp-content/uploads/2008/10/logo-rootkit.gif" alt="" title="" width="125" height="133" class="alignleft size-full wp-image-315" /></p>
<p>
    Ils existent deux services permettant de détecter d&#8217;éventuels rootkits sur votre serveur :</p>
<ul>
<li>chkrootkit</li>
<li>rkhunter</li>
</ul>
<p><span id="more-313"></span></p>
<p>
    Commençons par les installer :</p>

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

</p>
<p>
    Configuration de RKHunter suivant votre système, ce script modifie des dossier cachés de Débian pour qu&#8217;il soit ignorés de rkhunter et modifie la directive du login root suivant la configuration.<br />
    Dans notre cas, le login root est interdit :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">SSH_ROOT_ALLOWED</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">TEST_ROOT_ALLOWED</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;PermitRootLogin.*yes&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>sshd_config<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TEST_ROOT_ALLOWED</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #007800;">SSH_ROOT_ALLOWED</span>=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s|^[#]*(ALLOWHIDDENDIR=/dev/.udev)$|1|'</span> \ 
<span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s|^[#]*(ALLOWHIDDENDIR=/dev/.static)$|1|'</span> \
<span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s|^[#]*(ALLOWHIDDENDIR=/dev/.initramfs)$|1|'</span> \
<span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s|^[#]*\(ALLOW_SSH_ROOT_USER=\).*$|\1<span style="color: #007800;">${SSH_ROOT_ALLOWED}</span>|&quot;</span> \ 
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rkhunter.conf</pre></div></div>

<p>    Vous pouvez copiez/collez le bloc directement dans la console.
</p>
<p>
    Vous pouvez ensuite modifier l&#8217;email de la tache CRON pour recevoir l&#8217;email du rapport rkhunter, en éditant le fichier /etc/default/rkhunter :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Defaults for rkhunter cron jobs</span>
<span style="color: #666666; font-style: italic;"># sourced by /etc/cron.*/rkhunter</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This is a POSIX shell fragment</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Set this to the email address where reports and run output should be sent</span>
<span style="color: #007800;">REPORT_EMAIL</span>=<span style="color: #ff0000;">&quot;monemail&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set this to yes to enable rkhunter weekly database updates</span>
<span style="color: #007800;">CRON_DB_UPDATE</span>=<span style="color: #ff0000;">&quot;yes&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set this to yes to enable reports of weekly database updates</span>
<span style="color: #007800;">DB_UPDATE_EMAIL</span>=<span style="color: #ff0000;">&quot;yes&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set this to yes to enable rkhunter daily runs</span>
<span style="color: #007800;">CRON_DAILY_RUN</span>=<span style="color: #ff0000;">&quot;yes&quot;</span></pre></div></div>

</p>
<p>
    Pour que chkrootkit s&#8217;exécute tous les jours la commande suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/RUN_DAILY=.*/RUN_DAILY=&quot;true&quot;/'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>chkrootkit.conf</pre></div></div>

</p>
<p>
    Il y a un faux positif, qui devrait être corrigé dans un patch prochain, en attendant, éditez le fichier /usr/sbin/chkrootkit (Ligne 700 environ) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${QUIET}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;t&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> printn 
<span style="color: #ff0000;">&quot;Searching for suspicious files and dirs, it may take a while... &quot;</span>; <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">files</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #800000;">${find}</span> <span style="color: #800000;">${DIR}</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;.[A-Za-z]*&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;...*&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;.. *&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">dirs</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #800000;">${find}</span> <span style="color: #800000;">${DIR}</span> <span style="color: #660033;">-type</span> d <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;.*&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${files}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${dirs}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span></pre></div></div>

</p>
<p>
    Modifiez la ligne files par :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">files</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #800000;">${find}</span> <span style="color: #800000;">${DIR}</span> \<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;.[A-Za-z]*&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;...*&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;.. *&quot;</span> \<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-and</span> <span style="color: #660033;">-not</span> <span style="color: #660033;">-wholename</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>init<span style="color: #000000; font-weight: bold;">/</span>rw<span style="color: #000000; font-weight: bold;">/</span>.ramfs<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

</p>
<p>
    Pour recevoir un rapport quotidien sur votre email, editez le fichier /etc/crontab et ajoutez les lignes suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span> <span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> root <span style="color: #000000; font-weight: bold;">`</span>chkrootkit <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> mail moi<span style="color: #000000; font-weight: bold;">@</span>monemail.com <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Résultats de chkrootkit MONSERVEUR&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000;">5</span> <span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> root <span style="color: #000000; font-weight: bold;">`</span>rkhunter <span style="color: #660033;">-c</span> <span style="color: #660033;">--cronjob</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> mail moi<span style="color: #000000; font-weight: bold;">@</span>monemail.com <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Résultats de rkhunter MONSERVEUR&quot;</span><span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

</p>
<p>
    Pour le moment, les emails ne sont pas délivrés, ils nous faudra d&#8217;abord installé le serveur d&#8217;emails.<br />
    Mais vous pouvez à tout moment lancer l&#8217;un ou l&#8217;autre pour voir les rapports :</p>

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

</p>
<p>
Prochaine étape installation du serveur mysql. <img src='http://www.anthor.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-protection-contre-les-rootkits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serveur Dédié Debian Etch 64bit chez OVH &#8211; Installation de Fail2Ban</title>
		<link>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-de-fail2ban/</link>
		<comments>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-de-fail2ban/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 15:45:21 +0000</pubDate>
		<dc:creator>Anthor</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.anthor.net/?p=305</guid>
		<description><![CDATA[Pour le moment même si notre serveur ne dispose d&#8217;aucun service web, il est protégé d&#8217;un grand nombre d&#8217;attaques qui essayeront des combinaisons de mots de passe afin d&#8217;entrer sur votre serveur. Puisque nous avons bloquer l&#8217;accès SSH à root, ils devront aussi essayer de trouver le login. Vous me direz c&#8217;est bien mais un [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.anthor.net/wp-content/uploads/2008/10/fail2ban_logo.png" alt="" title="" width="135" height="130" class="alignleft size-full wp-image-310" /><br />
Pour le moment même si notre serveur ne dispose d&#8217;aucun service web, il est protégé d&#8217;un grand nombre d&#8217;attaques qui essayeront des combinaisons de mots de passe afin d&#8217;entrer sur votre serveur.</p>
<p>Puisque nous avons bloquer l&#8217;accès SSH à root, ils devront aussi essayer de trouver le login.<br />
Vous me direz c&#8217;est bien mais un hacker qui squatte les accès SSH pour rentrer sur le serveur, ça bloque du processus.<br />
Afin d&#8217;éviter cela, nous allons installer fail2ban qui permet de bloquer temporairement l&#8217;accès à votre serveur aux IPs ayant plus de 5 tentatives ratées.</p>
<p>En plus de protéger votre serveur sur l&#8217;accès SSH, fail2ban permet aussi de contrôler les logins Apache, FTP, Mails&#8230;<br />
Imaginons qu&#8217;une IP XXX.XXX.XXX.XXX essaye de se connecter 5 fois en FTP, elle sera bannie directement sur IPTable durant le temps défini dans la configuration.</p>
<p><span id="more-305"></span><br />
La première chose à faire consiste à installer fail2ban :</p>

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

<p>Puis éditer le fichier de configuration, comme il est expliqué, il ne faut pas modifier le fichier de configuration original mais le fichier local, afin d&#8217;éviter des problèmes lors des futurs mises à jour :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fail2ban<span style="color: #000000; font-weight: bold;">/</span>jail.local</pre></div></div>

<p>Pour le moment, nous remettons juste les lignes [DEFAULT] et [SSH], les lignes sont assez simples à comprendre.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>DEFAULT<span style="color: #7a0874; font-weight: bold;">&#93;</span>
ignoreip = 127.0.0.1 MONIP MADEUXIEMEIP
bantime  = <span style="color: #000000;">600</span>
maxretry = <span style="color: #000000;">5</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Destination email address used solely for the interpolations in</span>
<span style="color: #666666; font-style: italic;"># jail.{conf,local} configuration files.</span>
destemail = moi<span style="color: #000000; font-weight: bold;">@</span>monemail.com
&nbsp;
<span style="color: #666666; font-style: italic;"># Default action to take: ban &amp;amp; send an e-mail with whois report</span>
<span style="color: #666666; font-style: italic;"># and relevant log lines to the destemail.</span>
action = iptables<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">name</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>__name__<span style="color: #7a0874; font-weight: bold;">&#41;</span>s, <span style="color: #007800;">port</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>port<span style="color: #7a0874; font-weight: bold;">&#41;</span>s<span style="color: #7a0874; font-weight: bold;">&#93;</span>
mail-whois-lines<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">name</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>__name__<span style="color: #7a0874; font-weight: bold;">&#41;</span>s, <span style="color: #007800;">dest</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>destemail<span style="color: #7a0874; font-weight: bold;">&#41;</span>s, <span style="color: #007800;">logpath</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>logpath<span style="color: #7a0874; font-weight: bold;">&#41;</span>s<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">ssh</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
enabled = <span style="color: #c20cb9; font-weight: bold;">true</span>
port    = <span style="color: #c20cb9; font-weight: bold;">ssh</span>
filter  = sshd
logpath  = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>auth.log
maxretry = <span style="color: #000000;">5</span></pre></div></div>

<p>Plus tard nous rajouterons les lignes correspondant aux services que nous installerons tel qu&#8217;Apache ou proftpd. Il ne reste plus qu&#8217;à redémarrer le service pour appliquer les modifications.</p>

<div class="wp_syntax"><div class="code"><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>fail2ban restart</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-installation-de-fail2ban/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serveur Dédié Debian Etch 64bit chez OVH &#8211; Sécuriser SSH et l&#8217;accès root</title>
		<link>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-securiser-ssh-et-lacces-root/</link>
		<comments>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-securiser-ssh-et-lacces-root/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 20:30:27 +0000</pubDate>
		<dc:creator>Anthor</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.anthor.net/?p=297</guid>
		<description><![CDATA[Une dès première phase pour sécuriser un minimum votre serveur est de modifier le port par défaut sur lequel vous vous connectez en SSH. Installer open-ssh : apt-get install openssh-server Pour cela, on édite le fichier de configuration avec VI : vim /etc/ssh/sshd_config Et modifier la ligne Port 22 par Port XXX où XXX est [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.anthor.net/wp-content/uploads/2008/10/Openssh.png" alt="" title="" width="150" height="148" class="alignleft size-full wp-image-301" /><br />
Une dès première phase pour sécuriser un minimum votre serveur est de modifier le port par défaut sur lequel vous vous connectez en <strong>SSH</strong>.</p>
<p>Installer open-ssh :</p>

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

<p><span id="more-297"></span><br />
Pour cela, on édite le fichier de configuration avec <strong>VI</strong> :</p>

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

<p>Et modifier la ligne Port 22 par Port XXX où XXX est le port que vous aurez choisi.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># What ports, IPs and protocols we listen for</span>
Port <span style="color: #000000;">4583</span></pre></div></div>

<p>Redémarrez ensuite le service <strong>SSH</strong> avec la commande suivante :</p>

<div class="wp_syntax"><div class="code"><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><span style="color: #c20cb9; font-weight: bold;">ssh</span> restart</pre></div></div>

<p>Lors de la prochaine connexion avec <strong>PUTTY</strong>, n&#8217;oubliez pas de changer le port en conséquence.</p>
<p>La deuxième phase consiste à bloquer le login sous root par <strong>SSH</strong>. Cela évitera un grand nombre de tentative d&#8217;intrusion. <strong>Su</strong> permet de devenir un autre utilisateur pour la durée d’une session. Dans le cas présent nous utilisons <strong>su</strong> pour devenir root une fois la connexion au serveur effectué.</p>
<p>La première chose à faire et de créer un nouvel utilisateur (LOGIN) et de lui donner un mot de passe. C&#8217;est cet utilisateur qui vous servira à vous connecter en SSH.</p>

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

<p>Pour vérifier que l&#8217;utilisateur est bien créé, vous pouvez relancer PUTTY et tenter de vous connecter avec ce nouvel utilisateur. Si la connection à réussi, vous pouvez constater que vous ne pouvez pas faire grand chose, par exemple il vous est impossible d&#8217;installer un paquet.<br />
Maintenant effectuer la commande et rentrer ensuite votre mot de passe root :</p>

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

<p>Si tout se passe bien vous êtes maintenant connecté en root et pouvez effectuer toutes les opérations voulues.<br />
<strong>ATTENTION:</strong> Vous devez obligatoirement avoir un utilisateur pour vous connecter en SSH avant d&#8217;interdire l&#8217;accès à root</p>
<p>Il ne reste plus qu&#8217;à éditer le fichier de configuration du services SHH afin que seul votre utilisateur LOGIN ait le droit de se connecter en SSH, sécurisant ainsi votre accès à votre serveur par SSH.<br />
Ajoutez la ligne suivante dans /etc/ssh/sshd_config</p>

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

<p>Et modifier PermitRootLogin à no :</p>

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

<p>Redémarrez SSH. C&#8217;est fini !<br />
    Dans la prochaine étape nous procéderons à l&#8217;installation de fail2ban pour éviter les tentatives d&#8217;intrusions répétées.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-securiser-ssh-et-lacces-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serveur Dédié Debian Etch 64bit chez OVH &#8211; Configuration de base</title>
		<link>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-configuration-de-base/</link>
		<comments>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-configuration-de-base/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 21:50:43 +0000</pubDate>
		<dc:creator>Anthor</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.anthor.net/?p=289</guid>
		<description><![CDATA[Voilà première partie de différents articles sur la configuration d&#8217;un serveur dédié en Debian Etch 64 bits. L&#8217;installation se fait sur un SP MINI. Le serveur possédera toutes les fonctions de base d&#8217;un serveur LAMP, avec Apache2, PHP5, Serveur Mail, Webmin, Virtualmin&#8230; Nous configurons d&#8217;abord les locales pour avoir l&#8217;utf8 et l&#8217;iso-8859-1 : echo &#34;fr_FR [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.anthor.net/wp-content/uploads/2008/10/logo-debian.jpg" alt="" title="" width="100" height="123" class="alignleft size-full wp-image-294" /><br />
Voilà première partie de différents articles sur la configuration d&#8217;un serveur dédié en Debian Etch 64 bits.<br />
L&#8217;installation se fait sur un <a href="https://www.ovh.com/fr/produits/superplan_mini.xml">SP MINI</a>.<br />
Le serveur possédera toutes les fonctions de base d&#8217;un serveur LAMP, avec Apache2, PHP5, Serveur Mail, Webmin, Virtualmin&#8230;</p>
<p><span id="more-289"></span></p>
<p>Nous configurons d&#8217;abord les locales pour avoir l&#8217;utf8 et l&#8217;iso-8859-1 :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;fr_FR ISO-8859-1
fr_FR.UTF-8 UTF-8
fr_FR.UTF-8@euro UTF-8
fr_FR@euro ISO-8859-15&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>locale.gen
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^LANG=.*/LANG=fr_FR.UTF-8/'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>locale
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^LANG=.*/LANG=fr_FR/'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>environment
<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>locale-gen</pre></div></div>

<p>Vous pouvez copier/coller directement tout le bloc dans putty dans votre console SSH.</p>
<p>Mettre ensuite la liste des paquets à jour avec la commande :</p>

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

<p>Puis mettre à jour les paquets :</p>

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

<p>Nous installons NTP, afin que l&#8217;heure de notre serveur soit toujours synchronisée et VIM qui permet d&#8217;éditer les fichiers de façon plus simple que VI, et mailx pour envoyer les emails de rapports dans un premier temps.</p>

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

<p>Nous activons la coloration de la commande ls, pour le côté pratique :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile</pre></div></div>

<p>Ajouter à la fin les lignes suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LS_OPTIONS</span>=<span style="color: #ff0000;">'--color=auto'</span>
<span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">dircolors</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">ls</span>=<span style="color: #ff0000;">'ls $LS_OPTIONS'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">ll</span>=<span style="color: #ff0000;">'ls $LS_OPTIONS -l'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">l</span>=<span style="color: #ff0000;">'ls $LS_OPTIONS -lA'</span></pre></div></div>

<p>Pour appliquer immédiatement les modifications, effectuez la commande suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile</pre></div></div>

<p>Nous appliquons aussi la coloration à VIM pour le rendre plus agréable :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vim<span style="color: #000000; font-weight: bold;">/</span>vimrc.local</pre></div></div>

<p>Mettez y les lignes suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">syntax on 
<span style="color: #000000; font-weight: bold;">set</span> paste 
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">background</span>=dark 
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">softtabstop</span>=<span style="color: #000000;">4</span> 
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">shiftwidth</span>=<span style="color: #000000;">4</span> 
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">tabstop</span>=<span style="color: #000000;">4</span> 
<span style="color: #000000; font-weight: bold;">set</span> expandtab</pre></div></div>

<p>Le serveur est maintenant prêt à être sécuriser et configurer.<br />
Par la suite je traiterais la modification du port SSH et l&#8217;installation d&#8217;open-ssh, et l&#8217;interdiction de l&#8217;utilisateur root au profit d&#8217;un utilisateur auxiliaire et de Sudo.</p>
<p>EDIT: Pensez à mettre PUTTY en UTF-8 à votre prochaine connexion dans l&#8217;onglet Translations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthor.net/blog/gnulinux/serveur-dedie-debian-etch-64bit-chez-ovh-configuration-de-base/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

