From owner-freebsd-questions@FreeBSD.ORG Mon Apr 26 17:06:30 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41B34106566B for ; Mon, 26 Apr 2010 17:06:30 +0000 (UTC) (envelope-from AARON.J.BAUER@saic.com) Received: from cpmx.mail.saic.com (cpmx.mail.saic.com [139.121.17.160]) by mx1.freebsd.org (Postfix) with ESMTP id 142828FC1C for ; Mon, 26 Apr 2010 17:06:29 +0000 (UTC) Received: from 0599-its-sbg03.saic.com ([139.121.21.144] [139.121.21.144]) by cpmx.mail.saic.com with ESMTP id BT-MMP-11838142; Mon, 26 Apr 2010 10:06:23 -0700 X-AuditID: 8b79132a-b7cceae000005886-b9-4bd5c80f411f Received: from 0599-its-exbh01.us.saic.com (cpg-z7-si-srcnat.sw.saic.com [139.121.21.144]) by 0599-its-sbg03.saic.com (Symantec Brightmail Gateway) with SMTP id 80.A6.22662.F08C5DB4; Mon, 26 Apr 2010 10:06:23 -0700 (PDT) Received: from 0461-its-exmb04.us.saic.com ([10.8.67.27]) by 0599-its-exbh01.us.saic.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 26 Apr 2010 10:06:23 -0700 Received: from 10.31.250.17 ([10.31.250.17]) by 0461-its-exmb04.us.saic.com ([10.8.67.27]) via Exchange Front-End Server cpmail.saic.com ([139.121.17.197]) with Microsoft Exchange Server HTTP-DAV ; Mon, 26 Apr 2010 17:06:23 +0000 MIME-Version: 1.0 From: "Bauer, Aaron J." In-Reply-To: References: , To: Thread-Topic: Setup Fail2Ban on FreeBSD Thread-Index: AcrlYy6M1i9vZoVeQE+S5TY26NbO6g== Message-Id: <6D7CCDF5-E96F-4CEA-A08C-8E916DDC81F8@mimectl> X-Mailer: Microsoft Outlook Web Access 6.5.7651.60 X-MimeCtl: Produced By Microsoft Exchange V6.5.7651.60 Date: Mon, 26 Apr 2010 10:09:07 -0700 X-OriginalArrivalTime: 26 Apr 2010 17:06:23.0923 (UTC) FILETIME=[CCD02830:01CAE562] X-Brightmail-Tracker: AAAAAA== X-Mailman-Approved-At: Mon, 26 Apr 2010 17:16:49 +0000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-questions@freebsd.org" Subject: RE: Setup Fail2Ban on FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 17:06:30 -0000 I only have one problem with this. Ports is disabled in FreeNAS, and so I = performed the install through pkg_add. When I run the /usr/local/etc/rc.d/= fail2ban start, I get "command not found" Aaron=20 Software Research Intern=20 Aaron.J.Bauer@SAIC.com From: Chris Rees Sent: Sat 4/24/2010 11:32 AM To: Bauer, Aaron J. Cc: freebsd-questions@freebsd.org Subject: Re: Setup Fail2Ban on FreeBSD On 23 April 2010 18:49, Bauer, Aaron J. wrote: > I am currently using FreeNAS 0.7 for a file server. I have multiple SSH = bruteforce attacks each week, and wish to use fail2ban to prevent this. > > I don't have much experience with BSD, and am having trouble getting ever= ything to work. I ran pkg_add -r python25 and pkg_add -r py25-fail2ban. I= now have all the files for Fail2Ban, and did the cp jail.conf jail.local a= s the other distro's for linux use. > > However, how do I start using fail2ban? I have configured it for CentOS = and Ubuntu, and it starts in init.d. I don't know how to add it to /etc/rc= .d to get it to work correctly.. > > Any help is greatly appreciated. If you need more info, please let me kn= ow. > > Aaron > Software Research Intern > Aaron.J.Bauer@SAIC.com What everyone else has missed out is that ports install their rc files into /usr/local/etc/rc.d, rather than /etc which is reserved for the base system. Fail2ban already installs an rc.d script, so you don't need to do anything. So, /etc/rc.conf can be used, and add fail2ban_enable=3D"YES" Then from the prompt run: # /usr/local/etc/rc.d/fail2ban start Chris