windowsgitsshfail2ban

fail2ban repeatedly banning authorized user


I wonder what help you can provide me with,

I am repeatedly banned by fail2ban when I use the fork software on my windows computer to git pull and push to a git repo that is hosted on a Hetzner cloud.

What I then need to do is to log to the cloud's console and: sudo fail2ban-client set sshd unbanip XX.XX.XX.XX This usually does the trick and I can pull/push.

But I will be banned after a few minutes again !

I don't understand why or how to trace the reason for that.Essentially I understand that fail2ban should block my ip if I try to ssh connect with the wrong credentials multiple time in a minimal time. But this blocking/unblocking scenario occurs as I use the software with my stored credentials... any idea ?

I have tried.. removing an option on fork that was looking to automatically pull anything that was updated on the remote/origin and I have checked my credentials... which evidently work when I not banned... At some point I was connecting from vscode. This is in my mind because I'm just wondering, if perhaps there is a background process that tries to ssh connect and wonder how I would go about to identify this. I mean, I also have sql workbench and have tried other db managers in the past, at the end of the day my ssh credentials are not solely tied to the git software. Also could geography or time zones play a role ? I don't think so...


Solution

  • The autofetch setting was enabled in my vs code with the credentials, not of the project but of my github account.

    autofetch setting: 
    Settings > git > autofetch > true/false
    

    My project is using different credentials. So I assume that fail2ban was banning my IP because of unsuccessful autofetching attempts from vs code.

    At this point I turned autofetch off. But there are options to add git credentials to the project's scope.

    The subject is discussed in a number of places such as:

    How to configure multiple git accounts in Visual Studio Code workspace