One of the first things to do when installing a new DirectAdmin server should be the installation of CSF (ConfigServer Security & Firewall). According to their own website this is:

A Stateful Packet Inspection (SPI) firewall, Login/Intrusion Detection and Security application for Linux servers.

You can use this software to configure the firewall on your system and it can block IP’s with to many failed login attempts for you.

I’m installing on CentOS 6.6 x64 running on a BladeVPS PureSSD from TransIP.

Log on to your server using Putty or any other SSH client.

Switch to root and input your root password:

su

Make a directory to download the software and switch to it:

mkdir /tmp/install

cd /tmp/install

Download the software from the publishers site:

wget https://download.configserver.com/csf.tgz

Untar the file and switch to the newly created folder:

tar -xzf csf.tgz

cd csf

Run the installer, this will autodetect your DirectAdmin install and run the right installer:

sh install.sh

Next, check if iptables is installed correctly:

perl /usr/local/csf/bin/csftest.pl

This should tell you that everything is OK and you are ready to go:

Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing xt_connlimit...OK
Testing ipt_owner/xt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OK
Testing iptable_nat/ipt_DNAT...OK

RESULT: csf should function on this server

You should now have a CSF entry in your DirectAdmin menu:


DA-CSF

More about configuration of CSF in a next post.