<?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>Jonathan's Blog &#187; linux</title>
	<atom:link href="http://blog.exeko.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.exeko.com</link>
	<description>un blog pas comme les autres ...</description>
	<lastBuildDate>Fri, 30 Oct 2009 21:33:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stop spam flood attack with postfix and iptables</title>
		<link>http://blog.exeko.com/2008/06/stop-spam-flood-postfix-iptables/</link>
		<comments>http://blog.exeko.com/2008/06/stop-spam-flood-postfix-iptables/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 12:01:47 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[shell scripts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[spam flood]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/?p=30</guid>
		<description><![CDATA[For about 2 or 3 months, I constantly get attacked by an army of robots trying to spam my mailbox for the domain exeko.com  that by the way is participating in the busby seo challenge and a few of my clients domains. Yesterday night the spam flood attack was so violent that my poor [...]]]></description>
			<content:encoded><![CDATA[<p>For about 2 or 3 months, I constantly get attacked by an army of robots trying to spam my mailbox for the domain exeko.com  that by the way is participating in the <a href="http://exeko.com/busby-seo-challenge/">busby seo challenge</a> and a few of my clients domains. Yesterday night the spam flood attack was so violent that my poor little server hosted by <a href="http://www.ovh.com">OVH</a> started to swap like a crazy cow !</p>
<p>I finally decided to write a little shell script to read the mail log file and extract the last minute of log to count the number of rejected attempts to send mail to my server by the same host and ban this host using iptables if a defined limit is reached.</p>
<p>Here is a version of my script:<br />
<code>#!/bin/bash<br />
IPT=/sbin/iptables<br />
LIMIT=10<br />
cd /root/Filters<br />
# first get one minute of log<br />
grep "`date +"%b %d %H:%M:" --date="1 minutes ago"`" /var/log/mail.info > minutelog<br />
# now extract the rejected attempts, sort and count uniq ip<br />
cat minutelog | grep "reject:" | cut -d" " -f10 | cut -d"[" -f2 | cut -d"]" -f 1 | sort | uniq -c | sort -n | sed 's/^[ \t]*//' > tmp1<br />
# for each line in result<br />
while read line<br />
do<br />
  MYCOUNT=`echo $line | cut -d" " -f1`<br />
  MYIP=`echo $line | cut -d" " -f2`<br />
  if  [ $MYCOUNT -lt $LIMIT ] ;<br />
  then<br />
    echo $MYIP is ok: $MYCOUNT attempts<br />
  else<br />
    echo blocking the spammer at $MYIP with $MYCOUNT attempts<br />
    $IPT -I INPUT -i eth0 --proto tcp -s $MYIP --destination-port 25 -j DROP<br />
    echo $MYIP >> blocked.smtp<br />
  fi<br />
done < tmp1<br />
rm -f minutelog<br />
rm -f tmp1</code><br />
You can also download this script here: <a href='http://blog.exeko.com/wp-content/uploads/2008/06/filter_smtp.zip'>filter_smtp.zip</a></p>
<p>This shell script is running for about 12 hours on my mail server and it already stopped 701 spamming machines. Any feedback on the script is welcome ! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2008/06/stop-spam-flood-postfix-iptables/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Update clamav-daemon on debian etch</title>
		<link>http://blog.exeko.com/2008/05/update-clamav-daemon-on-debian-etch/</link>
		<comments>http://blog.exeko.com/2008/05/update-clamav-daemon-on-debian-etch/#comments</comments>
		<pubDate>Fri, 30 May 2008 08:37:31 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/?p=27</guid>
		<description><![CDATA[I noticed that the version of clamav (0.90) in debian etch is sometime hanging randomly and mails are deferred and never delivered to the mailboxes. We can install clamav from the volatile repository to correct this problem. Here is what i did:
We need to add a line in /etc/apt/sources.list
vi /etc/apt/sources.list
Simply paste this line at the [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed that the version of clamav (0.90) in debian etch is sometime hanging randomly and mails are deferred and never delivered to the mailboxes. We can install clamav from the volatile repository to correct this problem. Here is what i did:<br />
We need to add a line in /etc/apt/sources.list<br />
<code>vi /etc/apt/sources.list</code><br />
Simply paste this line at the end of the file:<br />
<code>deb-src http://volatile.debian.org/debian-volatile sarge/volatile main contrib non-free</code><br />
<code>apt-get update</code><br />
We first build all the dependency for clamav-daemon<br />
<code>apt-get build-dep clamav-daemon</code><br />
Now we fetch the source of clamav-daemon and build the package<br />
<code>cd /usr/src<br />
apt-get source clamav-daemon<br />
 cd clamav-0.92.1dfsg/<br />
dpkg-buildpackage -uc -us -rfakeroot -nc</code><br />
Then we just need to install the necessary packages<br />
<code>dpkg -i clamav-base_0.92.1dfsg-0volatile1_all.deb<br />
dpkg -i libclamav3_0.92.1dfsg-0volatile1_i386.deb<br />
dpkg -i clamav-daemon_0.92.1dfsg-0volatile1_i386.deb</code></p>
<p>That&#8217;s all ! Your antivirus is now updated and ready to scan mails</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2008/05/update-clamav-daemon-on-debian-etch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install vmware tools on Debian Etch Virtual Machine</title>
		<link>http://blog.exeko.com/2008/02/install-vmware-tools-on-debian-etch-virtual-machine/</link>
		<comments>http://blog.exeko.com/2008/02/install-vmware-tools-on-debian-etch-virtual-machine/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 07:40:51 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[vmware tools]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/2008/02/12/install-vmware-tools-on-debian-etch-virtual-machine/</guid>
		<description><![CDATA[To continue my tutorial on how to install VMware Server on debian Etch we will now install the vmware tools in one of our debian Virtual machines. The wmware tools are needed if you want to be able to stop a virtual machine from the command line using vmware-cmd and it can also help to [...]]]></description>
			<content:encoded><![CDATA[<p>To continue my tutorial on <a href="http://blog.exeko.com/2008/02/12/vmware-server-install-on-debian-etch/" title="vmware server debian etch howto">how to install VMware Server on debian Etch</a> we will now install the vmware tools in one of our debian Virtual machines. The wmware tools are needed if you want to be able to stop a virtual machine from the command line using vmware-cmd and it can also help to correct the Time sync problem with virtual machines running debian.</p>
<p>First we install the required packages:<br />
<code>apt-get install autoconf automake binutils cpp gcc linux-headers-$(uname -r) make psmisc</code><br />
Now we need to connect to our vmware server using the vmware server console. We need to start the debian virtual machine in order to install the vmware tools. As soon as your virtual machine is started you can right click on it&#8217;s name in the inventory and click on &#8220;Install vmware tools&#8221;. Log into your virtual machine and do the following to mount the virtual cdrom<br />
<code>mount /dev/cdrom</code><br />
You should be able to see your cdrom using the command mount. Mine is mounted at /media/cdrom0<br />
You just have to copy the vmware tools to another location and install it.<br />
<code>cd /media/cdrom0<br />
cp VMwareTools-1.0.4-56528.tar.gz /tmp<br />
cd /tmp<br />
tar -zxvf VMwareTools-1.0.4-56528.tar.gz<br />
cd vmware-tools-distrib<br />
./vmware-install.pl</code><br />
Just follow the installation script and press enter to accept the default for every question.</p>
<p>Et voila ! <img src='http://blog.exeko.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You may notice that your virtual machine clock is running to fast or to slow. In this case you need to edit the configuration file for your virtual machine (the .vmx file) and change the value of tools.syncTime to &#8220;TRUE&#8221;.<br />
You also need to edit the file /boot/grub/menu.lst and add the following kernel options: clocksource=pit nosmp noapic nolapic nohz=off<br />
Your file should then look something like this:<br />
<code>[...]<br />
title           Debian GNU/Linux, kernel 2.6.18-5-686<br />
root            (hd0,0)<br />
kernel          /boot/vmlinuz-2.6.18-5-686 root=/dev/sda1 ro clocksource=pit nosmp noapic nolapic nohz=off<br />
initrd          /boot/initrd.img-2.6.18-5-686<br />
savedefault<br />
[...]</code></p>
<p>Another cool tip to finish ? ok let&#8217;s go !<br />
You may need to copy a virtual machine and run another copy of it at the same time. In this case you will notice that if you change the identifier of the virtual machine (you have to if you want to run them at the same time) the network interface is changing from eth0 to eth1 and incrementing each time you duplicate the machine. To correct this you simply need to delete one file in your virtual machine and reboot it:<br />
<code>rm -f /etc/udev/rules.d/z25_persistent-net.rules</code></p>
<p>Any questions ? <img src='http://blog.exeko.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2008/02/install-vmware-tools-on-debian-etch-virtual-machine/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VMware Server install on Debian Etch</title>
		<link>http://blog.exeko.com/2008/02/vmware-server-install-on-debian-etch/</link>
		<comments>http://blog.exeko.com/2008/02/vmware-server-install-on-debian-etch/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 07:37:26 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[debian etch]]></category>
		<category><![CDATA[vmware howto]]></category>
		<category><![CDATA[vmware server]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/2008/02/12/vmware-server-install-on-debian-etch/</guid>
		<description><![CDATA[After a long time wihtout any post here is a simple How to install vmware server on debian etch.
We start by installing the necessary packages:
apt-get update
apt-get upgrade
apt-get install libx11-6 libx11-dev libxtst6 libxext6 libxt6 libice6 libsm6 libxrender1 xinetd
apt-get install linux-headers-`uname -r` build-essential sysvinit-utils psmisc gcc binutils-doc make manpages-dev autoconf automake1.9 libtool flex bison gdb libc6-dev-amd64 lib64gcc1 [...]]]></description>
			<content:encoded><![CDATA[<p>After a long time wihtout any post here is a simple How to install vmware server on debian etch.</p>
<p>We start by installing the necessary packages:<br />
<code>apt-get update<br />
apt-get upgrade<br />
apt-get install libx11-6 libx11-dev libxtst6 libxext6 libxt6 libice6 libsm6 libxrender1 xinetd<br />
apt-get install linux-headers-`uname -r` build-essential sysvinit-utils psmisc gcc binutils-doc make manpages-dev autoconf automake1.9 libtool flex bison gdb libc6-dev-amd64 lib64gcc1 gcc-2.95-doc</code></p>
<p>Now we download and install VMware Server:<br />
<code>cd /usr/src<br />
wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.4-56528.tar.gz<br />
tar -zxvf VMware-server-1.0.4-56528.tar.gz<br />
cd vmware-server-distrib/<br />
./vmware-install.pl</code><br />
Simply press enter for all the questions and maybe change the path where you will store your virtual machines to something easy to find ( I put all my virtual machines in /var/VMachines)<br />
You will need to register for your free serial number at the following url: <a href="http://register.vmware.com/content/registration.html">http://register.vmware.com/content/registration.html</a></p>
<p>That&#8217;s all ! VMware server is installed.<br />
If you intend to connect to this machine remotely using the vmware server console then you need to edit the file /etc/vmware/pam.d/vmware-authd. Simply replace the content of your file by this:<br />
<code>#%PAM-1.0<br />
auth       sufficient       pam_unix.so shadow nullok<br />
auth       required         pam_unix_auth.so shadow nullok<br />
account    sufficient       pam_unix2.so<br />
account    required         pam_unix_acct.so</code></p>
<p>Now restart vmware and install it at boot time:<br />
<code>update-rc.d vmware defaults 20<br />
/etc/init.d/vmware restart</code></p>
<p>You can download a debian etch minimal install ready to be used:<br />
<code>cd /var/VMachines<br />
wget http://mirror.o-line.net/vmware/debian-4.0r1-netinst.7z<br />
apt-get install p7zip<br />
p7zip -d debian-4.0r1-netinst.7z</code></p>
<p>Easy isn&#8217;t it ?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2008/02/vmware-server-install-on-debian-etch/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Debian vi disable autoindent when pasting</title>
		<link>http://blog.exeko.com/2007/12/debian-vi-disable-autoindent-when-pasting/</link>
		<comments>http://blog.exeko.com/2007/12/debian-vi-disable-autoindent-when-pasting/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 15:22:55 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[disable auto indent]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/2007/12/23/debian-vi-disable-autoindent-when-pasting/</guid>
		<description><![CDATA[Today i finally found how to stop vi to insert tab or comment my text when i paste something:
simply input the command
:set paste
then paste what you want to paste and
:set nopaste
Hoo and by the way, from now on, i will start posting only in english
]]></description>
			<content:encoded><![CDATA[<p>Today i finally found how to stop vi to insert tab or comment my text when i paste something:<br />
simply input the command<br />
<code>:set paste</code><br />
then paste what you want to paste and<br />
<code>:set nopaste</code></p>
<p>Hoo and by the way, from now on, i will start posting only in english</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2007/12/debian-vi-disable-autoindent-when-pasting/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Setup debian ovh &#8211; monitoring</title>
		<link>http://blog.exeko.com/2007/12/setup-debian-ovh-monitoring/</link>
		<comments>http://blog.exeko.com/2007/12/setup-debian-ovh-monitoring/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 15:20:59 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[debian monitoring]]></category>
		<category><![CDATA[debian ovh]]></category>
		<category><![CDATA[monit]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[process monitoring]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/2007/12/14/setup-debian-ovh-monitoring/</guid>
		<description><![CDATA[Comme promis voici le 2èm post de la journée pour compléter le tutorial d&#8217;installation d&#8217;une machine debian chez ovh.
Nous venons juste de voir comment installer et configurer un firewall pour protéger notre machine, Voyons maintenant comment utiliser munin et monit pour surveiller notre serveur.
Munin nous fourni des graphs sur l&#8217;état de notre machine: ressources utilisées, [...]]]></description>
			<content:encoded><![CDATA[<p>Comme promis voici le 2èm post de la journée pour compléter le tutorial d&#8217;<a href="http://blog.exeko.com/2007/12/04/mon-installation-debian-chez-ovh/" title="installation debian ovh">installation d&#8217;une machine debian chez ovh</a>.<br />
Nous venons juste de voir comment <a href="http://blog.exeko.com/2007/12/14/setup-debian-ovh-firewall/" title="setup firewall debian ovh">installer et configurer un firewall</a> pour protéger notre machine, Voyons maintenant comment utiliser munin et monit pour surveiller notre serveur.<br />
Munin nous fourni des graphs sur l&#8217;état de notre machine: ressources utilisées, traffic, queue du serveur postfix et j&#8217;en passe.<br />
Monit lui monitor nos process et nous informe si quelque chose ne va pas. De plus il est capable de redémarrer tout seul un service qui ne fonctionne pas comme il faut.</p>
<p>On install d&#8217;abord <strong>munin</strong>:<br />
<code>apt-get install munin munin-node</code><br />
Puis on edite le fichier de configuration pour rajouter le nom de notre machine:<br />
<code>vi /etc/munin/munin.conf</code><br />
Ca doit ressembler à ca:<br />
<code># a simple host tree<br />
[nsxxxxx.ovh.net]<br />
address 127.0.0.1<br />
use_node_name yes</code><br />
Il ne nous reste plus qu&#8217;à proteger l&#8217;accès a munin avec un htaccess:<br />
<code>vi /var/www/munin/.htaccess</code><br />
en voici le contenu<br />
<code>AuthType Basic<br />
AuthName "Admin Only"<br />
AuthUserFile /var/www/.htpasswd<br />
&lt;limit GET PUT POST&gt;<br />
require valid-user<br />
&lt;/limit&gt;</code><br />
puis on crée le password:<br />
<code>htpasswd -c /var/www/.htpasswd admin</code><br />
Voila, si tout va bien on peut maintenant se connecter à http://nsxxxxx.ovh.net/munin à l&#8217;aide du user admin et du pass qu&#8217;on viens de choisir ! Par contre il faut attendre au moins 5 a 10 minutes pour voir quelque chose sur les graphs.</p>
<p>Passsons maintenant a <strong>Monit</strong><br />
Comme toujours, installation super simple:<br />
<code>apt-get install monit</code><br />
Puis on edite le fichier de configuration<br />
<code>vi /etc/monit/monitrc</code><br />
Voici le fichier de configuration dont on a besoin pour surveiller notre machine debian et tous les services que nous avons installés dans mon premier tutorial sur debian ovh.<br />
<code>set daemon  60<br />
set logfile syslog facility log_daemon<br />
set mailserver localhost<br />
set mail-format { from: monit@yourdomain.com }<br />
set alert yourmail@yourdomain.com<br />
set httpd port 2812 and<br />
allow admin:yourmonitpass<br />
# check FTP server<br />
check process proftpd with pidfile /var/run/proftpd.pid<br />
start program = "/etc/init.d/proftpd start"<br />
stop program  = "/etc/init.d/proftpd stop"<br />
if failed port 21 protocol ftp then restart<br />
if 5 restarts within 5 cycles then timeout<br />
# check SSH server<br />
check process sshd with pidfile /var/run/sshd.pid<br />
start program  "/etc/init.d/ssh start"<br />
stop program  "/etc/init.d/ssh stop"<br />
if failed port 22 protocol ssh then restart<br />
if 5 restarts within 5 cycles then timeout<br />
# check MySQL<br />
check process mysql with pidfile /var/run/mysqld/mysqld.pid<br />
group database<br />
start program = "/etc/init.d/mysql start"<br />
stop program = "/etc/init.d/mysql stop"<br />
if failed host 127.0.0.1 port 3306 then restart<br />
if 5 restarts within 5 cycles then timeout<br />
# check WEB server<br />
check process apache with pidfile /var/run/apache2.pid<br />
group www<br />
start program = "/etc/init.d/apache2 start"<br />
stop program  = "/etc/init.d/apache2 stop"<br />
if failed host ns28885.ovh.net port 80 protocol http<br />
and request "/monit/token" then restart<br />
if cpu is greater than 60% for 2 cycles then alert<br />
if cpu &gt; 80% for 5 cycles then restart<br />
if totalmem &gt; 500 MB for 5 cycles then restart<br />
if children &gt; 250 then restart<br />
if loadavg(5min) greater than 10 for 8 cycles then stop<br />
if 3 restarts within 5 cycles then timeout<br />
# check MAIL server<br />
check process postfix with pidfile /var/spool/postfix/pid/master.pid<br />
group mail<br />
start program = "/etc/init.d/postfix start"<br />
stop  program = "/etc/init.d/postfix stop"<br />
if failed port 25 protocol smtp then restart<br />
if 5 restarts within 5 cycles then timeout<br />
</code></p>
<p>il faut encore éditer le fichier /etc/default/monit pour que monit puisse démarrer:<br />
<code>vi /etc/default/monit</code><br />
On change startup à 1<br />
<code>startup=1</code></p>
<p>pour pouvoir monitor apache et vérifier que les sites web répondent on cree un fichier que monit viendra check:<br />
<code>mkdir /var/www/monit<br />
echo "Hello" > /var/www/monit/token</code></p>
<p>Et finalement on lance monit:<br />
<code>/etc/init.d/monit start</code><br />
Et voila ! On peut maintenant se connecter a l&#8217;interface web de monit a l&#8217;url suivante: http://nsxxxxx.ovh.net:2812</p>
<p>Nous avons maintenant une machine debian prète à héberger nos sites et emails. N&#8217;hésitez pas à me poser des questions si quelque chose n&#8217;est pas clair.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2007/12/setup-debian-ovh-monitoring/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setup debian ovh &#8211; Firewall</title>
		<link>http://blog.exeko.com/2007/12/setup-debian-ovh-firewall/</link>
		<comments>http://blog.exeko.com/2007/12/setup-debian-ovh-firewall/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 12:20:31 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ovh]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/2007/12/14/setup-debian-ovh-firewall/</guid>
		<description><![CDATA[Aujourd&#8217;hui 2 petits post qui vont venir completer mon premier post sur mon installation debian chez ovh. Le premier tout de suite avec la configuration d&#8217;un firewall simple pour notre machine.
On verifie si iptables est installé sur la machine (normalement oui)
iptables -v
iptables v1.3.6: no command specified
Try `iptables -h' or 'iptables --help' for more information.
si on [...]]]></description>
			<content:encoded><![CDATA[<p>Aujourd&#8217;hui 2 petits post qui vont venir completer mon premier post sur mon <a href="http://blog.exeko.com/2007/12/04/mon-installation-debian-chez-ovh/" title="debian ovh full setup">installation debian chez ovh</a>. Le premier tout de suite avec la configuration d&#8217;un firewall simple pour notre machine.</p>
<p>On verifie si iptables est installé sur la machine (normalement oui)<br />
<code>iptables -v</code><br />
<code>iptables v1.3.6: no command specified<br />
Try `iptables -h' or 'iptables --help' for more information.</code></p>
<p>si on obtiens un resultat comme celui la c&#8217;est ok et on verifie si il existe déjà des règles:<br />
<code>iptables -L</code><br />
<code>Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination<br />
Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</code></p>
<p>aucun règle actuellement: notre firewall accepte donc tout le traffic.<br />
créons nos regles dans le fichier /etc/init.d/firewall<br />
<code>vi /etc/init.d/firewall</code><br />
<code>#!/bin/sh<br />
# les regles de mon firewall<br />
IPT=/sbin/iptables<br />
case "$1" in<br />
start)<br />
$IPT -F INPUT<br />
$IPT -I INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT<br />
$IPT -A INPUT -i eth0 --proto tcp --destination-port ftp -j ACCEPT<br />
$IPT -A INPUT -i eth0 --proto tcp --destination-port ssh -j ACCEPT<br />
$IPT -A INPUT -i eth0 --proto tcp --destination-port smtp -j ACCEPT<br />
$IPT -A INPUT -i eth0 --proto tcp --destination-port pop3 -j ACCEPT<br />
$IPT -A INPUT -i eth0 --proto tcp --destination-port domain -j ACCEPT<br />
$IPT -A INPUT -i eth0 --proto udp --destination-port domain -j ACCEPT<br />
$IPT -A INPUT -i eth0 --proto tcp --destination-port http -j ACCEPT<br />
$IPT -A INPUT -i eth0 --proto tcp --destination-port https -j ACCEPT<br />
$IPT -A INPUT -i eth0 --proto icmp -j ACCEPT<br />
$IPT -A INPUT -i eth0 -j DROP<br />
exit 0<br />
;;<br />
stop)<br />
$IPT -F INPUT<br />
exit 0<br />
;;<br />
*)<br />
echo "Usage: /etc/init.d/firewall {start|stop}"<br />
exit 1<br />
;;<br />
esac</code><br />
Pour faire simple on accepte toutes les connection déjà établies et on authorise les connections à nos services: FTP, SSH, SMTP, POP3, DNS et HTTP.<br />
On rajoute les droits d&#8217;éxecution au fichier et on démarre notre firewall<br />
<code>chmod +x /etc/init.d/firewall<br />
/etc/init.d/firewall start</code></p>
<p>Il ne nous reste plus qu&#8217;à installer ce script au boot pour que notre firewall se relance automatiquement. Attention ne faire cette manipulation que si vous êtes sur d&#8217;avoir access à votre machine par ssh !<br />
<code>update-rc.d firewall defaults</code></p>
<p>Et voila ! Simple non ? prochain post: monitoring de notre machine avec munin et monit</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2007/12/setup-debian-ovh-firewall/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mon installation debian chez OVH</title>
		<link>http://blog.exeko.com/2007/12/mon-installation-debian-chez-ovh/</link>
		<comments>http://blog.exeko.com/2007/12/mon-installation-debian-chez-ovh/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 16:48:21 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian ovh]]></category>
		<category><![CDATA[mysql5]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/2007/12/04/mon-installation-debian-chez-ovh/</guid>
		<description><![CDATA[Description étape par étape de mon installation à partir d&#8217;une installation debian minimale chez OVH.
serveur DNS: bind9
Serveur Web: Apache2+php5+mysql+phpmyadmin
Serveur mail: postfix+courrier avec antivirus et antispam
Serveur FTP: ProFTPD
Avant tout il serait bon de jeter un coup d&#8217;oeil a mon post précédant sur Putty afin de pouvoir se connecter a notre machine a l&#8217;aide de clef SSH.
Maintenant [...]]]></description>
			<content:encoded><![CDATA[<p>Description étape par étape de mon installation à partir d&#8217;une installation debian minimale chez OVH.</p>
<p>serveur DNS: bind9<br />
Serveur Web: Apache2+php5+mysql+phpmyadmin<br />
Serveur mail: postfix+courrier avec antivirus et antispam<br />
Serveur FTP: ProFTPD</p>
<p>Avant tout il serait bon de jeter un coup d&#8217;oeil a mon post précédant sur <a title="Tutorial putty SSH key based login" href="http://blog.exeko.com/2007/11/06/tutorial-ssh-key-based-login-avec-putty/" target="_blank">Putty</a> afin de pouvoir se connecter a notre machine a l&#8217;aide de clef SSH.</p>
<p>Maintenant on se connecte a notre machine avec le pass recu par email pour le compte root juste apres la réinstallation de la machine et on copie notre clef publique (<a title="Tutorial putty SSH" href="http://blog.exeko.com/2007/11/06/tutorial-ssh-key-based-login-avec-putty/" target="_blank">voir tutorial putty</a>).<br />
<code>vi ~/.ssh/authorized_keys2</code><br />
Normalement on doit deja trouver la clef de ovh donc on copie la notre a la fin du fichier juste apres celle de ovh.<br />
On test maintenant de se connecter avec notre clef et si tout se passe bien on peut maintenant désactiver l&#8217;authentification par mot de passe.<br />
<code>vi /etc/ssh/sshd_config</code><br />
on modifie les 2 lignes suivantes<br />
<code>PasswordAuthentication no<br />
UsePAM no</code><br />
attention il faudra absolument avoir votre clef sur vous pour vous connecter à votre machine !</p>
<p>On met à jour notre system avec les 2 lignes suivantes:<br />
<code>apt-get update<br />
apt-get upgrade</code></p>
<p>Puis on installe quelques outils necessaires pour la suite:<br />
<code>apt-get install build-essential bison flex dpkg-dev</code></p>
<p>On install Quota et on modifie le fichier /etc/fstab pour activer le quota sur notre partition /<br />
<code>apt-get install quota<br />
vi /etc/fstab</code><br />
on rajoute simplement ,errors=remount-ro,usrquota,grpquota juste après defaults pour la partition /<br />
puis<br />
<code>touch /quota.user /quota.group<br />
chmod 600 /quota.*<br />
mount -o remount /<br />
quotacheck -avugm<br />
quotaon -avug</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2007/12/mon-installation-debian-chez-ovh/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>tutorial &#8211; SSH key-based login avec Putty</title>
		<link>http://blog.exeko.com/2007/11/tutorial-ssh-key-based-login-avec-putty/</link>
		<comments>http://blog.exeko.com/2007/11/tutorial-ssh-key-based-login-avec-putty/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 11:57:00 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[key-based login]]></category>
		<category><![CDATA[pageant]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[puttygen]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/2007/11/06/tutorial-ssh-key-based-login-avec-putty/</guid>
		<description><![CDATA[L&#8217;utilisation de clefs pour se connecter à un système unix par ssh peut être non seulement pratique (pas besoin de taper un password à chaque reconnection) mais aussi plus sécurisé que l&#8217;authentification traditionelle par mot de passe (si on désactive cette dernière!)
Depuis notre station windows il nous faut les logiciels Putty, Puttygen et pageant disponible [...]]]></description>
			<content:encoded><![CDATA[<p>L&#8217;utilisation de clefs pour se connecter à un système unix par ssh peut être non seulement pratique (pas besoin de taper un password à chaque reconnection) mais aussi plus sécurisé que l&#8217;authentification traditionelle par mot de passe (si on désactive cette dernière!)</p>
<p>Depuis notre station windows il nous faut les logiciels <a href="http://the.earth.li/%7Esgtatham/putty/latest/x86/putty.exe" title="download putty" target="_blank">Putty</a>, <a href="http://the.earth.li/%7Esgtatham/putty/latest/x86/puttygen.exe" title="download puttygen" target="_blank">Puttygen</a> et <a href="http://the.earth.li/%7Esgtatham/putty/latest/x86/pageant.exe" title="download pageant" target="_blank">pageant</a> disponible sur la <a href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/download.html" title="putty download page" target="_blank">page de téléchargement de Putty.</a></p>
<p>On lance putty et on crée un nouveau profil pour notre serveur et on sauve la session avant de s&#8217;y connecter.</p>
<p>On lance puttygen pour générer notre paire de clefs, on choisi SSH-2 RSA de 1024 bits et on clic sur generate. Une fois nos clef générées on tape notre email dans le champs key comment, on choisi une passphrase que l&#8217;on confirme une 2ème fois et on clic sur save public key et save private key. On prends bien soins de ranger les clefs dans un endroit sûr !</p>
<p>On copie la clef dans la fenêtre de puttygen juste en dessous de la phrase &#8220;Public key pasting into OpenSSH authorized_keys file:&#8221;</p>
<p>Normalement vous devez avoir un shell ouvert avec putty sur votre serveur: on doit y coller notre clef publique:<br />
<code>mkdir ~/.ssh<br />
chmod 700 ~/.ssh<br />
vi ~/.ssh/authorized_keys2 </code></p>
<p>On colle notre clef précédement copiée de puttygen, on sauvegarde et on quitte puis<br />
<code>chmod 600 ~/.ssh/authorized_keys2</code></p>
<p>Testons maintenant ! On ouvre un autre putty et on load le profile pour notre serveur.<br />
On va dans connection et on tape notre username dans le champ Auto-login username.<br />
on va ensuite sur SSH et on choisi 2 dans preferred SSH protocol version.<br />
puis dans SSH -&gt; Auth on clic sur Browse et on indique le fichier de notre clef privée.<br />
On reviens sur session et on sauvegarde nos changements.</p>
<p>On peut maintenant tester notre première connection SSH à l&#8217;aide de clefs !<br />
On clic sur Open donc, et normalement le serveur nous demande notre passphrase puis nous  identifie .</p>
<p>Si c&#8217;est le cas on peut alors désactiver l&#8217;authentification par mot de passe :<br />
<code>vi /etc/ssh/sshd_config</code><br />
On change PasswordAuthentication no et UsePAM no puis on reload notre serveur ssh<br />
<code>/etc/init.d/sshd reload</code></p>
<p>Si vous obtenez un mesage du style<br />
<code>Trying public key authentication.<br />
Key is of wrong type (PuTTY SSH2 private key)</code><br />
C&#8217;est que vous essayez de vous connecter à un serveur ssh en utilisant le protocole SSH1. Vérifiez bien dans les options de votre profile putty pour ce serveur que vous avez coché &#8220;2&#8243; ou &#8220;only 2&#8243; dans preferred protocol version  et ajoutez dans votre /etc/ssh/sshd_config<br />
<code>Protocol 2</code></p>
<p>Tout fonctionne ? ok mais il faut quand même taper la passphrase à chaque connection et si vous vous connectez plusieurs fois par jours ( voir par heure) cela peut devenir pénible. Heureusement Pageant est la pour nous identifier à chaque fois que c&#8217;est nécessaire ! On essaie ?</p>
<p>On double click sur Pageant, on click sur Add Key et on indique notre clef privée. On donne à Pageant notre passphrase et on click sur Close. Tant que Pageant tourne nous pouvons nous connecter à notre serveur sans avoir besoin de saisir la passphrase.</p>
<p>Simple et pratique non  ?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2007/11/tutorial-ssh-key-based-login-avec-putty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>debian memcached install</title>
		<link>http://blog.exeko.com/2007/11/debian-memcached-install/</link>
		<comments>http://blog.exeko.com/2007/11/debian-memcached-install/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 17:49:15 +0000</pubDate>
		<dc:creator>eCliPs</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://blog.exeko.com/2007/11/04/debian-memcached-install/</guid>
		<description><![CDATA[Il faut deja installer libevent derniere version:
wget http://monkey.org/~provos/libevent-1.3e.tar.gz
tar -zxvf libevent-1.3e.tar.gz
cd libevent-1.3e
./configure
make &#38;&#38; make install
on cree un fichier /etc/ld.so.conf.d/libevent-i386.conf avec pour contenu
/usr/local/lib/
puis on execute:
ldconfig
On passe a l&#8217;installation de memcached maintenant:
cd /usr/local/src
wget http://danga.com/memcached/dist/memcached-1.2.2.tar.gz
tar -zxvf memcached-1.2.2.tar.gz
cd memcached-1.2.2
./configure --prefix=/virtual/memcached-1.2.2
make &#38;&#38; make install
Biensur on change &#8211;prefix= avec le path vers l&#8217;endroit ou on veut install memcached
il ne nous reste plus [...]]]></description>
			<content:encoded><![CDATA[<p>Il faut deja installer libevent derniere version:</p>
<p><code>wget http://monkey.org/~provos/libevent-1.3e.tar.gz<br />
tar -zxvf libevent-1.3e.tar.gz<br />
cd libevent-1.3e<br />
./configure<br />
make &amp;&amp; make install</code></p>
<p>on cree un fichier /etc/ld.so.conf.d/libevent-i386.conf avec pour contenu<br />
/usr/local/lib/</p>
<p>puis on execute:<br />
<code>ldconfig</code></p>
<p>On passe a l&#8217;installation de memcached maintenant:</p>
<p><code>cd /usr/local/src<br />
wget http://danga.com/memcached/dist/memcached-1.2.2.tar.gz<br />
tar -zxvf memcached-1.2.2.tar.gz<br />
cd memcached-1.2.2<br />
./configure --prefix=/virtual/memcached-1.2.2<br />
make &amp;&amp; make install</code></p>
<p>Biensur on change &#8211;prefix= avec le path vers l&#8217;endroit ou on veut install memcached</p>
<p>il ne nous reste plus qu&#8217;a creer le script de demarrage</p>
<p><code>vi /etc/init.d/memcached</code></p>
<p>Vous trouverez <a href="http://blog.exeko.com/wp-content/uploads/2007/11/memcached" title="le script de demarrage">ici</a> le script en question. Il faut modifier les 2 variables pour y indiquer le path vers l&#8217;install</p>
<p><code>chmod +x /etc/init.d/memcached</code></p>
<p>ensuite il faut creer le fichier <a href="http://blog.exeko.com/wp-content/uploads/2007/11/start-memcached" target="_blank" title="memcached perl script">start-memcached</a> dans le repertoire d&#8217;installation de memcached</p>
<p><code>vi /virtual/memcached-1.2.2/bin/start-memcached</code></p>
<p>On edite aussi ce fichier pour changer le path vers l&#8217;installation et on rajoute les droits d&#8217;execution</p>
<p><code>chmod +x /virtual/memcached-1.2.2/bin/start-memcached</code></p>
<p>et pour finir on cree le fichier /etc/memcached.conf<br />
<code>vi /etc/memcached.conf</code><br />
Voici son contenu<br />
<code>#Memory<br />
-m 256<br />
# default port<br />
-p 11211<br />
# user to run daemon<br />
-u user<br />
# (ip de la machine sur laquelle on install)<br />
-l 10.47.0.29<br />
</code></p>
<p>il reste plus qua rajouter memcached au demarrage<br />
<code>update-rc.d memcached defaults</code><br />
et on lance memcached<br />
<code>/etc/init.d/memcached start pour lancer</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.exeko.com/2007/11/debian-memcached-install/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
