IP Blocked in UFW, yet continue to see failed password attempts in auth.log

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












sudo ufw deny from 182.100.67.120
sudo service ufw restart


Yet, continuous entries in /var/log/auth.log



Feb 18 03:40:01 service sshd[2729]: Failed password for root from 182.100.67.120 port 51942 ssh2


If the IP is banned in UFW, why it is still getting into ssh login?










share|improve this question





















  • Try " sudo ufw status verbose " and past the output
    – Aravind
    Feb 18 at 9:48















up vote
1
down vote

favorite












sudo ufw deny from 182.100.67.120
sudo service ufw restart


Yet, continuous entries in /var/log/auth.log



Feb 18 03:40:01 service sshd[2729]: Failed password for root from 182.100.67.120 port 51942 ssh2


If the IP is banned in UFW, why it is still getting into ssh login?










share|improve this question





















  • Try " sudo ufw status verbose " and past the output
    – Aravind
    Feb 18 at 9:48













up vote
1
down vote

favorite









up vote
1
down vote

favorite











sudo ufw deny from 182.100.67.120
sudo service ufw restart


Yet, continuous entries in /var/log/auth.log



Feb 18 03:40:01 service sshd[2729]: Failed password for root from 182.100.67.120 port 51942 ssh2


If the IP is banned in UFW, why it is still getting into ssh login?










share|improve this question













sudo ufw deny from 182.100.67.120
sudo service ufw restart


Yet, continuous entries in /var/log/auth.log



Feb 18 03:40:01 service sshd[2729]: Failed password for root from 182.100.67.120 port 51942 ssh2


If the IP is banned in UFW, why it is still getting into ssh login?







ufw






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 18 at 3:41









Allen King

1161




1161











  • Try " sudo ufw status verbose " and past the output
    – Aravind
    Feb 18 at 9:48

















  • Try " sudo ufw status verbose " and past the output
    – Aravind
    Feb 18 at 9:48
















Try " sudo ufw status verbose " and past the output
– Aravind
Feb 18 at 9:48





Try " sudo ufw status verbose " and past the output
– Aravind
Feb 18 at 9:48











1 Answer
1






active

oldest

votes

















up vote
0
down vote













I figured out. Since port 22 is already open from anywhere, to block an IP to port 22, the deny entry has to go above the allow anywhere entry in UFW list. So the right command is (just inserting to the top of the list) :



sudo ufw insert 1 deny from 182.100.67.120
sudo service ufw restart


But before this, first I had to delete the deny entry using:



sudo ufw status numbered


Get the serial number of the previously entered deny entry for the above port, then



sudo ufw delete <serial number >





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    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',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1007271%2fip-blocked-in-ufw-yet-continue-to-see-failed-password-attempts-in-auth-log%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I figured out. Since port 22 is already open from anywhere, to block an IP to port 22, the deny entry has to go above the allow anywhere entry in UFW list. So the right command is (just inserting to the top of the list) :



    sudo ufw insert 1 deny from 182.100.67.120
    sudo service ufw restart


    But before this, first I had to delete the deny entry using:



    sudo ufw status numbered


    Get the serial number of the previously entered deny entry for the above port, then



    sudo ufw delete <serial number >





    share|improve this answer
























      up vote
      0
      down vote













      I figured out. Since port 22 is already open from anywhere, to block an IP to port 22, the deny entry has to go above the allow anywhere entry in UFW list. So the right command is (just inserting to the top of the list) :



      sudo ufw insert 1 deny from 182.100.67.120
      sudo service ufw restart


      But before this, first I had to delete the deny entry using:



      sudo ufw status numbered


      Get the serial number of the previously entered deny entry for the above port, then



      sudo ufw delete <serial number >





      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        I figured out. Since port 22 is already open from anywhere, to block an IP to port 22, the deny entry has to go above the allow anywhere entry in UFW list. So the right command is (just inserting to the top of the list) :



        sudo ufw insert 1 deny from 182.100.67.120
        sudo service ufw restart


        But before this, first I had to delete the deny entry using:



        sudo ufw status numbered


        Get the serial number of the previously entered deny entry for the above port, then



        sudo ufw delete <serial number >





        share|improve this answer












        I figured out. Since port 22 is already open from anywhere, to block an IP to port 22, the deny entry has to go above the allow anywhere entry in UFW list. So the right command is (just inserting to the top of the list) :



        sudo ufw insert 1 deny from 182.100.67.120
        sudo service ufw restart


        But before this, first I had to delete the deny entry using:



        sudo ufw status numbered


        Get the serial number of the previously entered deny entry for the above port, then



        sudo ufw delete <serial number >






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 19 at 4:54









        Allen King

        1161




        1161



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1007271%2fip-blocked-in-ufw-yet-continue-to-see-failed-password-attempts-in-auth-log%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

            Trouble downloading packages list due to a “Hash sum mismatch” error

            How do I move numbers in filenames, in a batch renaming operation?