Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Fail2Ban port number for SSH

General questions about VestaCP
Post Reply
  • Print view
Advanced search
5 posts • Page 1 of 1
Ghillie-up
Posts: 22
Joined: Fri Jun 20, 2014 8:35 am

Fail2Ban port number for SSH
  • Quote

Post by Ghillie-up » Sat Nov 15, 2014 11:30 am

So as most of you I am running shell access on an alternative port, let's say 2220 as an example.

Fail 2 band is listening for attempts on ssh via the ssh port number right? IE 22? How do I change this to the port number sshd is listening on so I can prevent brute force attempts on my box.

I have amended jail.conf to say:

[ssh-iptables]

enabled = true
filter = sshd
action = iptables[name=SSH, port=2220, protocol=tcp]
sendmail-whois[name=SSH, dest=[email protected], sender=[email protected], sendername="Fail2Ban"]
logpath = /var/log/secure
maxretry = 5

And restarted the service but I can still hammer ssh with Hydra. Any ideas guys?

Thanks.
Top

Milka
Posts: 137
Joined: Tue Feb 11, 2014 2:03 pm

Re: Fail2Ban port number for SSH
  • Quote

Post by Milka » Sat Nov 15, 2014 3:10 pm

You could try and edit the right file and then restart fail2ban again.

Code: Select all

/etc/fail2ban/jail.local
;-)
Top

Ghillie-up
Posts: 22
Joined: Fri Jun 20, 2014 8:35 am

Re: Fail2Ban port number for SSH
  • Quote

Post by Ghillie-up » Sat Nov 15, 2014 6:21 pm

What do I amend in this file exactly ?

[ssh-iptables]
enabled = true
filter = sshd
action = vesta[name=SSH]
logpath = /var/log/secure
maxretry = 5

Ta.
Top

Milka
Posts: 137
Joined: Tue Feb 11, 2014 2:03 pm

Re: Fail2Ban port number for SSH
  • Quote

Post by Milka » Sun Nov 16, 2014 4:16 pm

Ghillie-up wrote:What do I amend in this file exactly ?
Anything or everything you're written or changed in jail.conf... Just the fact that you haven't seen the port option in jail.local by default, doesn't mean you can't use it. The default fail2ban configuration file is jail.conf, but the configuration work should not be done in that file, hence we use a local copy of it. This is common fail2ban practice, not just in Vesta. You should make all of your desired configuration changes within the jail.local file.
Top

Ghillie-up
Posts: 22
Joined: Fri Jun 20, 2014 8:35 am

Re: Fail2Ban port number for SSH
  • Quote

Post by Ghillie-up » Sun Nov 16, 2014 7:39 pm

Ahh, makes sense. I have never used fail2ban before and the topics on serverfault suggest using .conf not .local hence where i went wrong.

Does fail2ban have logs itself ? I can see IPtables is injecting a rule but yet I am still hammering ssh with passwords. It's like it's oblivious.
Top


Post Reply
  • Print view

5 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password