Link to home
Start Free TrialLog in
Avatar of sharingsunshine
sharingsunshineFlag for United States of America

asked on

How Do I Upgrade Fail2ban 0.8.14 to 0.10.3 ?

I need to upgrade fail2ban 0.8.14 to 0.10.3.  I am on a Linux 2 server which prevents me from loading any repositories or using Yum to install it.

So, I need to know the steps to get my fail2ban upgraded.  

Thanks,
Avatar of noci
noci

Download fail2ban from:  http://www.fail2ban.org/
Then this should... be done (according to the README.md...)
    tar xvfj fail2ban-0.10.3.tar.bz2
    cd fail2ban-0.10.3
    python setup.py install

After which the setup should be in /etc/fail2ban....
Avatar of sharingsunshine

ASKER

Do I need to remove what is there already?  If so, what commands will remove the files.
Yes. Remove installed Fail2Ban first, via your package manager.

Looks like Linux 2 uses yum, so you'll remove your Fail2Ban RPMs via a yum command... likely...

yum remove fail2ban

Open in new window


If this fails, then likely Fail2Ban has another package name, which you'll have to dig around to find... likely...

yum list installed | grep -v fail2ban

Open in new window

Yes, Linux 2 uses Yum but in my original question please note:

I am on a Linux 2 server which prevents me from loading any repositories or using Yum to install it.
You can make a backup of the current /etc/fail2ban before removing it. You jails would be handy to keep near by at hand to either use again or use as template for a new jails.
I made a backup of the jails and filters but I am having trouble getting the archive to explode.  I used wget from the git archives.

https://gyazo.com/33c28abe472d6a6d9d18bb3e1ca35409

Open in new window


Here is the listing of the directory showing the archive and what it is named.

https://gyazo.com/391841820343d6e228b729f0bdaa5aaf

Open in new window

before removing the fail2ban  take backup of custom configuration if any,

download the latest fail2ban from following link,

https://github.com/fail2ban/fail2ban/archive/0.10.tar.gz
 extract and install
 make sure yiu have python version >=2.6

   tar xvfj fail2ban-0.10.3.tar.bz2
    cd fail2ban-0.10.3
    python setup.py install
try:   wget https://github.com/fail2ban/fail2ban/archive/0.10.tar.gz  or curl https://github.com/fail2ban/fail2ban/archive/0.10.tar.gz -o fail2ban-0.10.3.tar.bz2
I have no idea what gyazo  is...
fail2ban is maintained ongithub, so that is the original source.
gyazo is just a screenshot application

[root@ip-172-31-8-214 ~]# ls -la
total 84
dr-xr-x---  4 root root   244 Sep  2 10:46 .
dr-xr-xr-x 20 root root   283 Jul 25 16:52 ..
drwxr-xr-x  2 root root    25 Jul 22 17:49 .aws
-rw-------  1 root root 23742 Sep  2 05:21 .bash_history
-rw-r--r--  1 root root    18 Oct 18  2017 .bash_logout
-rw-r--r--  1 root root   176 Oct 18  2017 .bash_profile
-rw-r--r--  1 root root   176 Oct 18  2017 .bashrc
-rw-r--r--  1 root root   100 Oct 18  2017 .cshrc
-rw-r--r--  1 root root   123 Sep  2 10:46 fail2ban-0.10.3.tar.bz2
-rw-------  1 root root   866 Sep  2 04:38 .mysql_history
-rwxr-xr-x  1 root root 22322 Jul 26 12:09 ps_mem.py
-rw-------  1 root root  1024 Aug 21 07:34 .rnd
drwx------  2 root root    29 Jul 10 17:46 .ssh
-rw-r--r--  1 root root   129 Oct 18  2017 .tcshrc
-rw-r--r--  1 root root  1974 Jul 17 13:17 tortix-install.log
[root@ip-172-31-8-214 ~]# tar xvfj fail2ban-0.10.3.tar.bz2
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Open in new window

File file fail2ban-0.10.3.tar.bz2 probably tells you it is html...
Try to add -L to the curl command lineto pickup redirects.   (curl is more a basic API which needs to be told more)
curl -L https://github.com/fail2ban/fail2ban/archive/0.10.tar.gz -o fail2ban-0.10.3.tar.bz2

That should yield the bz2 file...  file fail2ban-0.10.3.tar.bz2  will tell you..
tar jxf filename.tar.bz2 should work
I got the file but I am still getting an error:

[root@ip-172-31-8-214 etc]# tar xvfj fail2ban-0.10.3.tar.bz2
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now
[root@ip-172-31-8-214 etc]# tar jxf fail2ban-0.10.3.tar.bz2
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Expanding on noci's update... the f option must directly before file, so just swap your f + j.

 Likely tar jxf fail2ban-0.10.3.tar.bz2 fails because you may have a corrupt file.

Try file fail2ban-0.10.3.tar.bz2 + see if you have some other magic number (file type) come up.
Noci, your responses were correct and also your extract command.  I have it installed now but there is some problem with not all of the jails working.  However, I will create another question about that.