Install fail2ban on RHEL/CentOS

Fail2ban is an open source free intrusion prevention framework developed in python programming language. Fail2ban operates by monitoring log files such as /var/log/pwdfail, /var/log/auth.log, /var/log/secure etc. and bans the IP address after too many password failure attempts. It used to update iptable firewall rules to reject the IP address for a specified amount of time.

Fail2ban runs as a daemon that uses python scripts to parse log files for system intrusion attempts and adds a custom rules to iptables configuration file to ban the access to certain ip addresses.

Install Fail2ban in Centos

Before heading up for installation and configuration of Fail2Ban, I would like to tell you that most of the attackers trying to gain root access via SSH. So, I recommend you to pay close attention to things such as disable ssh root logins and use pair of ssh keys for authentication etc.

“Install fail2ban on RHEL/CentOS”Continue reading

Noninteractive package installation on Debian squeezy – debconf way

Once you have many Debian servers, maintenance would be a problem. Sometimes, I would like to install Debian package in all of these servers. However, it takes too much time to ssh into every hosts, and answer the installation questions one by one.

Thanks for the debconf(1), it’s quite easy to do non-interactive installation, since debconf already provide a noninteractive frontend. All you need to do is set the configuration before you install the package. It can be done by debconf-set-selections.

“Noninteractive package installation on Debian squeezy – debconf way”Continue reading

DROP ALL TABLES в MySQL

The heading at this note is a bit wrong. In MySQL there is no such command, and it would be desirable, that it was. Sometimes there are problems in which we want to remove all tables of a DB, but not her (that there were its parametres, such as access rights, codings, etc.). To solve such problem it is possible with the help command:

a=name;b=pass;c=base;mysqldump -u$a -p$b --add-drop-table --no-data $c|grep ^DROP|mysql -u$a -p$b $c

The first command of the conveyor we create «dump» the databases, consisting of every possible DROP TABLE, but without the data. The second command we choose only the lines beginning with DROP, and at last, we fill in the received commands in MySQL.

Addition repositories for installation bacula and zabbix for OpenSuSe 12.1

Simple make it:

# LANG=en_US; zypper ar http://download.opensuse.org/repositories/Archiving:/Backup/openSUSE_12.1 bacula
Adding repository 'bacula' [done]
Repository 'bacula' successfully added
Enabled: Yes
Autorefresh: No
GPG check: Yes
URI: http://download.opensuse.org/repositories/Archiving:/Backup/openSUSE_12.1
#

и

# zypper ar http://download.opensuse.org/repositories/server:/monitoring/openSUSE_12.1 zabbix
Adding repository 'zabbix' [done]
Repository 'zabbix' successfully added
Enabled: Yes
Autorefresh: No
GPG check: Yes
URI: http://download.opensuse.org/repositories/server:/monitoring/openSUSE_12.1
#  
Scroll to top