Delete all fail2ban bans in Ubuntu Linux











up vote
6
down vote

favorite
2












How can I delete all fail2ban bans in Ubuntu?
I tried everything but I don't get it.



I just want to delete all bans - but I don't know any IP adresses.










share|improve this question




















  • 1




    The bans are typically done on IP addresses through your firewall, so you should look at the firewall rules.
    – Julie Pelletier
    May 28 '16 at 14:45










  • yes i know. but i want to clear all bans without telling a ip adress
    – Patrick
    May 28 '16 at 15:14















up vote
6
down vote

favorite
2












How can I delete all fail2ban bans in Ubuntu?
I tried everything but I don't get it.



I just want to delete all bans - but I don't know any IP adresses.










share|improve this question




















  • 1




    The bans are typically done on IP addresses through your firewall, so you should look at the firewall rules.
    – Julie Pelletier
    May 28 '16 at 14:45










  • yes i know. but i want to clear all bans without telling a ip adress
    – Patrick
    May 28 '16 at 15:14













up vote
6
down vote

favorite
2









up vote
6
down vote

favorite
2






2





How can I delete all fail2ban bans in Ubuntu?
I tried everything but I don't get it.



I just want to delete all bans - but I don't know any IP adresses.










share|improve this question















How can I delete all fail2ban bans in Ubuntu?
I tried everything but I don't get it.



I just want to delete all bans - but I don't know any IP adresses.







fail2ban






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 28 '16 at 17:13









Jeff Schaller

38.1k1053124




38.1k1053124










asked May 28 '16 at 14:42









Patrick

41112




41112








  • 1




    The bans are typically done on IP addresses through your firewall, so you should look at the firewall rules.
    – Julie Pelletier
    May 28 '16 at 14:45










  • yes i know. but i want to clear all bans without telling a ip adress
    – Patrick
    May 28 '16 at 15:14














  • 1




    The bans are typically done on IP addresses through your firewall, so you should look at the firewall rules.
    – Julie Pelletier
    May 28 '16 at 14:45










  • yes i know. but i want to clear all bans without telling a ip adress
    – Patrick
    May 28 '16 at 15:14








1




1




The bans are typically done on IP addresses through your firewall, so you should look at the firewall rules.
– Julie Pelletier
May 28 '16 at 14:45




The bans are typically done on IP addresses through your firewall, so you should look at the firewall rules.
– Julie Pelletier
May 28 '16 at 14:45












yes i know. but i want to clear all bans without telling a ip adress
– Patrick
May 28 '16 at 15:14




yes i know. but i want to clear all bans without telling a ip adress
– Patrick
May 28 '16 at 15:14










7 Answers
7






active

oldest

votes

















up vote
10
down vote













fail2ban uses iptables to block traffic. If you would want to see the IP addresses that are currently blocked, type



iptables -L -n


and look for the various chains named fail2ban-something, where something points to the fail2ban jail (for instance, Chain f2b-sshd refers to the jail sshd).
If you only want to remove the block for a single IP address <IP> for a given jail <JAIL>, fail2ban offers its own client:



fail2ban-client set <JAIL> unbanip <IP>


Alternatively you can use line numbers. First, list the iptables rules with line numbers:



iptables -L -n --line-numbers


Next you can use



iptables -D fail2ban-somejail <linenumber> 


to remove a single line from the table. As far as I know there is no option to select a range of line numbers, so I guess you would have to wrap this command in a for loop:



for lin in 1:200; do
iptables -D fail2ban-somejail $lin
done


Here I made the number 200 up. Check your own output of the command with --line-numbers and note that the last line (with RETURN) should stay.






share|improve this answer






























    up vote
    6
    down vote













    The best way to unban all IPs, is to set the bantime to 1 second, then all the IP will be freed right away.



    fail2ban-client set JailName bantime 1


    After that you can set the proper ban time back.



    It's better to let fail2ban to do the unban for you. Don't manually edit iptables yourself.






    share|improve this answer























    • This is the only correct answer here. Fail2ban maintains its own ban database that must be cleared independently. Every answer talking about deleting iptables rules ignores that the moment fail2ban is started back up it will re-add the rules you just deleted back to iptables. Also, not every fail2ban configuration uses iptables to implement bans.
      – Cliff Armstrong
      Jan 24 at 10:56












    • find all jails with fail2ban-client status
      – Flion
      Jul 16 at 18:12


















    up vote
    2
    down vote













    Save iptable config to file



    $ iptables-save > iptables.conf


    Edit it with any editor you like
    Than load config back to iptables



    $ iptables-restore < iptables.conf


    Do not forget to store configuration inside iptables so it will be picked up on reboot



    $ service iptables save
    iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]





    share|improve this answer





















    • This is one of the way one could do this. Thanks.
      – User9102d82
      Jul 15 '17 at 18:51


















    up vote
    2
    down vote













    1. stopping the service will clean all rules added by fail2ban



    service fail2ban stop



    2. if you do not have any other iptables rules, you can flush it



    iptables -F



    be careful: this will erase any other rules in your iptables.






    share|improve this answer






























      up vote
      1
      down vote













      Because of the way fail2ban works, there are only two possible solutions:




      • Make a firewall configuration script that includes fail2ban jails and restart the firewall.

      • Remove the firewall rules blocking the IPs that you wish to unban.






      share|improve this answer




























        up vote
        0
        down vote













        heres a simple oneliner to unban the whole fail2ban jail the proper way:



        iptables -L f2b-recidive -n | grep -o '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | grep -v 0.0.0.0 | xargs -n 1 fail2ban-client set recidive unbanip


        NOTE: iptables command takes "f2b-" prefix before the jail name while "fail2ban-client" the real jail name






        share|improve this answer




























          up vote
          0
          down vote













          The latest fail2ban-client (0.10) has a unban -all command. Jails can also be individually "restarted", effectively clearing the bans.



          If you have an older version, you can probably delete the jail which contains the ban then restart fail2ban so that the (now empty) jail would be recreated.



          For example:



          $ fail2ban-client stop sshd
          Jail stopped
          $ systemctl restart fail2ban





          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f286119%2fdelete-all-fail2ban-bans-in-ubuntu-linux%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            7 Answers
            7






            active

            oldest

            votes








            7 Answers
            7






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            10
            down vote













            fail2ban uses iptables to block traffic. If you would want to see the IP addresses that are currently blocked, type



            iptables -L -n


            and look for the various chains named fail2ban-something, where something points to the fail2ban jail (for instance, Chain f2b-sshd refers to the jail sshd).
            If you only want to remove the block for a single IP address <IP> for a given jail <JAIL>, fail2ban offers its own client:



            fail2ban-client set <JAIL> unbanip <IP>


            Alternatively you can use line numbers. First, list the iptables rules with line numbers:



            iptables -L -n --line-numbers


            Next you can use



            iptables -D fail2ban-somejail <linenumber> 


            to remove a single line from the table. As far as I know there is no option to select a range of line numbers, so I guess you would have to wrap this command in a for loop:



            for lin in 1:200; do
            iptables -D fail2ban-somejail $lin
            done


            Here I made the number 200 up. Check your own output of the command with --line-numbers and note that the last line (with RETURN) should stay.






            share|improve this answer



























              up vote
              10
              down vote













              fail2ban uses iptables to block traffic. If you would want to see the IP addresses that are currently blocked, type



              iptables -L -n


              and look for the various chains named fail2ban-something, where something points to the fail2ban jail (for instance, Chain f2b-sshd refers to the jail sshd).
              If you only want to remove the block for a single IP address <IP> for a given jail <JAIL>, fail2ban offers its own client:



              fail2ban-client set <JAIL> unbanip <IP>


              Alternatively you can use line numbers. First, list the iptables rules with line numbers:



              iptables -L -n --line-numbers


              Next you can use



              iptables -D fail2ban-somejail <linenumber> 


              to remove a single line from the table. As far as I know there is no option to select a range of line numbers, so I guess you would have to wrap this command in a for loop:



              for lin in 1:200; do
              iptables -D fail2ban-somejail $lin
              done


              Here I made the number 200 up. Check your own output of the command with --line-numbers and note that the last line (with RETURN) should stay.






              share|improve this answer

























                up vote
                10
                down vote










                up vote
                10
                down vote









                fail2ban uses iptables to block traffic. If you would want to see the IP addresses that are currently blocked, type



                iptables -L -n


                and look for the various chains named fail2ban-something, where something points to the fail2ban jail (for instance, Chain f2b-sshd refers to the jail sshd).
                If you only want to remove the block for a single IP address <IP> for a given jail <JAIL>, fail2ban offers its own client:



                fail2ban-client set <JAIL> unbanip <IP>


                Alternatively you can use line numbers. First, list the iptables rules with line numbers:



                iptables -L -n --line-numbers


                Next you can use



                iptables -D fail2ban-somejail <linenumber> 


                to remove a single line from the table. As far as I know there is no option to select a range of line numbers, so I guess you would have to wrap this command in a for loop:



                for lin in 1:200; do
                iptables -D fail2ban-somejail $lin
                done


                Here I made the number 200 up. Check your own output of the command with --line-numbers and note that the last line (with RETURN) should stay.






                share|improve this answer














                fail2ban uses iptables to block traffic. If you would want to see the IP addresses that are currently blocked, type



                iptables -L -n


                and look for the various chains named fail2ban-something, where something points to the fail2ban jail (for instance, Chain f2b-sshd refers to the jail sshd).
                If you only want to remove the block for a single IP address <IP> for a given jail <JAIL>, fail2ban offers its own client:



                fail2ban-client set <JAIL> unbanip <IP>


                Alternatively you can use line numbers. First, list the iptables rules with line numbers:



                iptables -L -n --line-numbers


                Next you can use



                iptables -D fail2ban-somejail <linenumber> 


                to remove a single line from the table. As far as I know there is no option to select a range of line numbers, so I guess you would have to wrap this command in a for loop:



                for lin in 1:200; do
                iptables -D fail2ban-somejail $lin
                done


                Here I made the number 200 up. Check your own output of the command with --line-numbers and note that the last line (with RETURN) should stay.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 27 '17 at 11:51

























                answered May 28 '16 at 15:46









                ph0t0nix

                518417




                518417
























                    up vote
                    6
                    down vote













                    The best way to unban all IPs, is to set the bantime to 1 second, then all the IP will be freed right away.



                    fail2ban-client set JailName bantime 1


                    After that you can set the proper ban time back.



                    It's better to let fail2ban to do the unban for you. Don't manually edit iptables yourself.






                    share|improve this answer























                    • This is the only correct answer here. Fail2ban maintains its own ban database that must be cleared independently. Every answer talking about deleting iptables rules ignores that the moment fail2ban is started back up it will re-add the rules you just deleted back to iptables. Also, not every fail2ban configuration uses iptables to implement bans.
                      – Cliff Armstrong
                      Jan 24 at 10:56












                    • find all jails with fail2ban-client status
                      – Flion
                      Jul 16 at 18:12















                    up vote
                    6
                    down vote













                    The best way to unban all IPs, is to set the bantime to 1 second, then all the IP will be freed right away.



                    fail2ban-client set JailName bantime 1


                    After that you can set the proper ban time back.



                    It's better to let fail2ban to do the unban for you. Don't manually edit iptables yourself.






                    share|improve this answer























                    • This is the only correct answer here. Fail2ban maintains its own ban database that must be cleared independently. Every answer talking about deleting iptables rules ignores that the moment fail2ban is started back up it will re-add the rules you just deleted back to iptables. Also, not every fail2ban configuration uses iptables to implement bans.
                      – Cliff Armstrong
                      Jan 24 at 10:56












                    • find all jails with fail2ban-client status
                      – Flion
                      Jul 16 at 18:12













                    up vote
                    6
                    down vote










                    up vote
                    6
                    down vote









                    The best way to unban all IPs, is to set the bantime to 1 second, then all the IP will be freed right away.



                    fail2ban-client set JailName bantime 1


                    After that you can set the proper ban time back.



                    It's better to let fail2ban to do the unban for you. Don't manually edit iptables yourself.






                    share|improve this answer














                    The best way to unban all IPs, is to set the bantime to 1 second, then all the IP will be freed right away.



                    fail2ban-client set JailName bantime 1


                    After that you can set the proper ban time back.



                    It's better to let fail2ban to do the unban for you. Don't manually edit iptables yourself.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Nov 10 '17 at 4:51









                    peterh

                    4,12092957




                    4,12092957










                    answered Nov 10 '17 at 3:13









                    Philip

                    6111




                    6111












                    • This is the only correct answer here. Fail2ban maintains its own ban database that must be cleared independently. Every answer talking about deleting iptables rules ignores that the moment fail2ban is started back up it will re-add the rules you just deleted back to iptables. Also, not every fail2ban configuration uses iptables to implement bans.
                      – Cliff Armstrong
                      Jan 24 at 10:56












                    • find all jails with fail2ban-client status
                      – Flion
                      Jul 16 at 18:12


















                    • This is the only correct answer here. Fail2ban maintains its own ban database that must be cleared independently. Every answer talking about deleting iptables rules ignores that the moment fail2ban is started back up it will re-add the rules you just deleted back to iptables. Also, not every fail2ban configuration uses iptables to implement bans.
                      – Cliff Armstrong
                      Jan 24 at 10:56












                    • find all jails with fail2ban-client status
                      – Flion
                      Jul 16 at 18:12
















                    This is the only correct answer here. Fail2ban maintains its own ban database that must be cleared independently. Every answer talking about deleting iptables rules ignores that the moment fail2ban is started back up it will re-add the rules you just deleted back to iptables. Also, not every fail2ban configuration uses iptables to implement bans.
                    – Cliff Armstrong
                    Jan 24 at 10:56






                    This is the only correct answer here. Fail2ban maintains its own ban database that must be cleared independently. Every answer talking about deleting iptables rules ignores that the moment fail2ban is started back up it will re-add the rules you just deleted back to iptables. Also, not every fail2ban configuration uses iptables to implement bans.
                    – Cliff Armstrong
                    Jan 24 at 10:56














                    find all jails with fail2ban-client status
                    – Flion
                    Jul 16 at 18:12




                    find all jails with fail2ban-client status
                    – Flion
                    Jul 16 at 18:12










                    up vote
                    2
                    down vote













                    Save iptable config to file



                    $ iptables-save > iptables.conf


                    Edit it with any editor you like
                    Than load config back to iptables



                    $ iptables-restore < iptables.conf


                    Do not forget to store configuration inside iptables so it will be picked up on reboot



                    $ service iptables save
                    iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]





                    share|improve this answer





















                    • This is one of the way one could do this. Thanks.
                      – User9102d82
                      Jul 15 '17 at 18:51















                    up vote
                    2
                    down vote













                    Save iptable config to file



                    $ iptables-save > iptables.conf


                    Edit it with any editor you like
                    Than load config back to iptables



                    $ iptables-restore < iptables.conf


                    Do not forget to store configuration inside iptables so it will be picked up on reboot



                    $ service iptables save
                    iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]





                    share|improve this answer





















                    • This is one of the way one could do this. Thanks.
                      – User9102d82
                      Jul 15 '17 at 18:51













                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    Save iptable config to file



                    $ iptables-save > iptables.conf


                    Edit it with any editor you like
                    Than load config back to iptables



                    $ iptables-restore < iptables.conf


                    Do not forget to store configuration inside iptables so it will be picked up on reboot



                    $ service iptables save
                    iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]





                    share|improve this answer












                    Save iptable config to file



                    $ iptables-save > iptables.conf


                    Edit it with any editor you like
                    Than load config back to iptables



                    $ iptables-restore < iptables.conf


                    Do not forget to store configuration inside iptables so it will be picked up on reboot



                    $ service iptables save
                    iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 27 '17 at 7:31









                    Subdigger

                    1213




                    1213












                    • This is one of the way one could do this. Thanks.
                      – User9102d82
                      Jul 15 '17 at 18:51


















                    • This is one of the way one could do this. Thanks.
                      – User9102d82
                      Jul 15 '17 at 18:51
















                    This is one of the way one could do this. Thanks.
                    – User9102d82
                    Jul 15 '17 at 18:51




                    This is one of the way one could do this. Thanks.
                    – User9102d82
                    Jul 15 '17 at 18:51










                    up vote
                    2
                    down vote













                    1. stopping the service will clean all rules added by fail2ban



                    service fail2ban stop



                    2. if you do not have any other iptables rules, you can flush it



                    iptables -F



                    be careful: this will erase any other rules in your iptables.






                    share|improve this answer



























                      up vote
                      2
                      down vote













                      1. stopping the service will clean all rules added by fail2ban



                      service fail2ban stop



                      2. if you do not have any other iptables rules, you can flush it



                      iptables -F



                      be careful: this will erase any other rules in your iptables.






                      share|improve this answer

























                        up vote
                        2
                        down vote










                        up vote
                        2
                        down vote









                        1. stopping the service will clean all rules added by fail2ban



                        service fail2ban stop



                        2. if you do not have any other iptables rules, you can flush it



                        iptables -F



                        be careful: this will erase any other rules in your iptables.






                        share|improve this answer














                        1. stopping the service will clean all rules added by fail2ban



                        service fail2ban stop



                        2. if you do not have any other iptables rules, you can flush it



                        iptables -F



                        be careful: this will erase any other rules in your iptables.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Mar 14 at 19:08









                        peterh

                        4,12092957




                        4,12092957










                        answered Jul 25 '17 at 13:46









                        RASG

                        1313




                        1313






















                            up vote
                            1
                            down vote













                            Because of the way fail2ban works, there are only two possible solutions:




                            • Make a firewall configuration script that includes fail2ban jails and restart the firewall.

                            • Remove the firewall rules blocking the IPs that you wish to unban.






                            share|improve this answer

























                              up vote
                              1
                              down vote













                              Because of the way fail2ban works, there are only two possible solutions:




                              • Make a firewall configuration script that includes fail2ban jails and restart the firewall.

                              • Remove the firewall rules blocking the IPs that you wish to unban.






                              share|improve this answer























                                up vote
                                1
                                down vote










                                up vote
                                1
                                down vote









                                Because of the way fail2ban works, there are only two possible solutions:




                                • Make a firewall configuration script that includes fail2ban jails and restart the firewall.

                                • Remove the firewall rules blocking the IPs that you wish to unban.






                                share|improve this answer












                                Because of the way fail2ban works, there are only two possible solutions:




                                • Make a firewall configuration script that includes fail2ban jails and restart the firewall.

                                • Remove the firewall rules blocking the IPs that you wish to unban.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered May 28 '16 at 17:10









                                Julie Pelletier

                                6,96211340




                                6,96211340






















                                    up vote
                                    0
                                    down vote













                                    heres a simple oneliner to unban the whole fail2ban jail the proper way:



                                    iptables -L f2b-recidive -n | grep -o '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | grep -v 0.0.0.0 | xargs -n 1 fail2ban-client set recidive unbanip


                                    NOTE: iptables command takes "f2b-" prefix before the jail name while "fail2ban-client" the real jail name






                                    share|improve this answer

























                                      up vote
                                      0
                                      down vote













                                      heres a simple oneliner to unban the whole fail2ban jail the proper way:



                                      iptables -L f2b-recidive -n | grep -o '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | grep -v 0.0.0.0 | xargs -n 1 fail2ban-client set recidive unbanip


                                      NOTE: iptables command takes "f2b-" prefix before the jail name while "fail2ban-client" the real jail name






                                      share|improve this answer























                                        up vote
                                        0
                                        down vote










                                        up vote
                                        0
                                        down vote









                                        heres a simple oneliner to unban the whole fail2ban jail the proper way:



                                        iptables -L f2b-recidive -n | grep -o '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | grep -v 0.0.0.0 | xargs -n 1 fail2ban-client set recidive unbanip


                                        NOTE: iptables command takes "f2b-" prefix before the jail name while "fail2ban-client" the real jail name






                                        share|improve this answer












                                        heres a simple oneliner to unban the whole fail2ban jail the proper way:



                                        iptables -L f2b-recidive -n | grep -o '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | grep -v 0.0.0.0 | xargs -n 1 fail2ban-client set recidive unbanip


                                        NOTE: iptables command takes "f2b-" prefix before the jail name while "fail2ban-client" the real jail name







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Sep 12 at 15:27









                                        Vedran B

                                        1




                                        1






















                                            up vote
                                            0
                                            down vote













                                            The latest fail2ban-client (0.10) has a unban -all command. Jails can also be individually "restarted", effectively clearing the bans.



                                            If you have an older version, you can probably delete the jail which contains the ban then restart fail2ban so that the (now empty) jail would be recreated.



                                            For example:



                                            $ fail2ban-client stop sshd
                                            Jail stopped
                                            $ systemctl restart fail2ban





                                            share|improve this answer

























                                              up vote
                                              0
                                              down vote













                                              The latest fail2ban-client (0.10) has a unban -all command. Jails can also be individually "restarted", effectively clearing the bans.



                                              If you have an older version, you can probably delete the jail which contains the ban then restart fail2ban so that the (now empty) jail would be recreated.



                                              For example:



                                              $ fail2ban-client stop sshd
                                              Jail stopped
                                              $ systemctl restart fail2ban





                                              share|improve this answer























                                                up vote
                                                0
                                                down vote










                                                up vote
                                                0
                                                down vote









                                                The latest fail2ban-client (0.10) has a unban -all command. Jails can also be individually "restarted", effectively clearing the bans.



                                                If you have an older version, you can probably delete the jail which contains the ban then restart fail2ban so that the (now empty) jail would be recreated.



                                                For example:



                                                $ fail2ban-client stop sshd
                                                Jail stopped
                                                $ systemctl restart fail2ban





                                                share|improve this answer












                                                The latest fail2ban-client (0.10) has a unban -all command. Jails can also be individually "restarted", effectively clearing the bans.



                                                If you have an older version, you can probably delete the jail which contains the ban then restart fail2ban so that the (now empty) jail would be recreated.



                                                For example:



                                                $ fail2ban-client stop sshd
                                                Jail stopped
                                                $ systemctl restart fail2ban






                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered yesterday









                                                Rolf

                                                134111




                                                134111






























                                                    draft saved

                                                    draft discarded




















































                                                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid



                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                    To learn more, see our tips on writing great answers.





                                                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                    Please pay close attention to the following guidance:


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid



                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                    To learn more, see our tips on writing great answers.




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function () {
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f286119%2fdelete-all-fail2ban-bans-in-ubuntu-linux%23new-answer', 'question_page');
                                                    }
                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown







                                                    Popular posts from this blog

                                                    サソリ

                                                    広島県道265号伴広島線

                                                    Setup Asymptote in Texstudio