Difference between revisions of "FAQ english"

From Fail2ban
Jump to navigationJump to search
(Undo revision 2379 by 93.174.93.200 (Talk))
Line 1: Line 1:
comment3
+
== '''Configuration''' ==
http://7.fortor.dvrdns.org/tdp2w2.html how to make blogspot
+
 
http://3.host.is-a-geek.org/xf72.html costochondritis how long does it last
+
=== What is the main configuration file for {{Fail2ban}}? ===
http://7.webius.servebbs.com/xjjntz.html worlds smallest website
+
 
http://7.hoolpy.dyn-o-saur.com/daq9d64.html how to apply hot fix crystals
+
{{Fail2ban}} configuration process is rather simple. There is only one configuration file, where {{Fail2ban}} can be fully configured, this file is located at:
http://2.jonny.dnsalias.com/cilqtw.html better home and garden patio furniture
+
<tt>/etc/fail2ban/fail2ban.conf</tt>
http://3.hoolpy.dyn-o-saur.com/hi5u7w.html video gratuit sur internet
+
 
http://6.host.is-a-geek.org/iem8vba.html digi makeover game
+
You are able to edit this file using any editor you want: vim, emacs, joe, ae...
http://4.hoolpy.dyn-o-saur.com/u21hzb.html how to clear temporary files
+
 
http://10.webius.servebbs.com/rm40d.html wholesale glycerine soap
+
Configuration file must be edited by '''root'''.
http://4.host.is-a-geek.org/71wnj.html france funny facts
+
 
http://3.mywy.homeip.net/z1en.html buying resale timeshares
+
=== How can {{Fail2ban}} be configured? ===
http://3.hoolpy.dyn-o-saur.com/h2pxou.html south park san diego homes
+
 
http://10.mywy.homeip.net/sg4r0w.html guitar parts pickups
+
This step is fully detailed at [[HOWTOs]] chapter
http://8.fortor.dvrdns.org/lji1.html timetable for ssc exams 2007
+
 
http://9.hoolpy.dyn-o-saur.com/245o3k.html alanda club marbella apartments
+
=== Can I exclude failed logins for selected users from resulting in a ban? ===
http://1.webius.servebbs.com/q9uluh0.html how to find trade in value
+
 
http://4.host.is-a-geek.org/6om3.html food front portland
+
(I don't know, perhaps that's a feature request.)
http://2.webius.servebbs.com/jj7wh.html fast multiresolution image
+
 
http://4.webius.servebbs.com/g09m.html black and white floral dresses
+
Edit: Cause fail2ban didn't know anything of the username format logged in the specific file(s) (if usernames even get logged), it is only possible to exclude selected users in the regex of the service section.
http://5.webius.servebbs.com/fvrb66.html home show secaucus nj
+
 
http://10.jonny.dnsalias.com/pzv3i3b.html lussino 4080 ice cream maker
+
=== Is there a way to have bans persist over restarts and log rotation? ===
http://7.jonny.dnsalias.com/b9a4zs9.html how to pray catholic
 
http://9.wifin.shacknet.nu/upuids.html steps to how to dance
 
http://10.hoolpy.dyn-o-saur.com/3q62pd.html informacion sobre la anorexia
 
http://10.mywy.homeip.net/wa7vv.html hollywood video augusta
 
http://4.dynos.gotdns.com/fipy6n.html biblical world history timeline
 
http://11.host.is-a-geek.org/hrr5a.html of prostate surgery in
 
http://11.hoolpy.dyn-o-saur.com/u6hgo8.html find ip address local network
 
http://7.host.is-a-geek.org/5fh8q.html transporting frozen food
 
http://5.dynos.gotdns.com/8nms9de.html around the world in 23 days
 
http://5.mywy.homeip.net/1mfl.html how to do illusion tricks
 
http://8.tests.dyndns.tv/b4hf8.html united states senate contact
 
http://10.neen.servegame.org/tyfs.html who are the gospels
 
http://9.fortor.dvrdns.org/izdis0a.html birthday parties metrowest
 
http://2.fortor.dvrdns.org/gxwb46.html history of mayonaise
 
http://6.host.is-a-geek.org/zk9m9.html heaviest woman in the world
 
http://7.tests.dyndns.tv/jv9grd.html today show recipes
 
http://11.webius.servebbs.com/s1ky0.html newton kansas newspapers
 
http://2.jonny.dnsalias.com/leaka.html igor vovchanchyn video
 
http://7.neen.servegame.org/8pyhy2.html how to change wiper blades
 
http://9.fortor.dvrdns.org/vjifbj8.html how to do a pap test
 
http://3.webius.servebbs.com/9x8i.html pcsxbox latest version
 
http://5.mywy.homeip.net/gyjxg.html womens final four
 
http://10.fortor.dvrdns.org/9qkb.html best in show dvd cover
 
http://9.wifin.shacknet.nu/izxtk.html where the sidewalk ends shel
 
http://3.fortor.dvrdns.org/bd4qjb8.html of africa showing all countries
 
http://2.webius.servebbs.com/urv5.html water cycle videos
 
http://3.jonny.dnsalias.com/42veou.html images of bridal bouquets
 
http://2.dynos.gotdns.com/dxwl8.html test broadband speeds
 
http://5.neen.servegame.org/my0c.html llonga apartments ibiza
 
http://8.fortor.dvrdns.org/shst5a2.html gulf coast movie times
 
http://6.wifin.shacknet.nu/0mlsq.html desktop games peter
 
http://10.host.is-a-geek.org/15a7.html to make frappichino
 
http://7.tests.dyndns.tv/xjv4g.html west virginia department education
 
http://1.fortor.dvrdns.org/it1yh0.html lamaison salad dressing
 
http://6.dynos.gotdns.com/oup27.html a walk in the woods test
 
http://11.jonny.dnsalias.com/he6ha.html number of baseball games per season
 
http://3.wifin.shacknet.nu/eqwat.html willie revillame and janelle
 
http://10.neen.servegame.org/nrc516.html how to make a boild
 
http://1.fortor.dvrdns.org/w20qy2n.html cowboy bebop wallpapers
 
http://4.webius.servebbs.com/qxh72.html alan jackson good time music
 
http://9.mywy.homeip.net/eszjc3.html how to be a millianare
 
http://4.hoolpy.dyn-o-saur.com/z78ve.html mutual fund assets under management
 
http://3.webius.servebbs.com/rgvpx5d.html employment services los angeles
 
http://3.mywy.homeip.net/uigd0wi.html flash slideshow 4.79
 
http://2.mywy.homeip.net/nyg7s0.html ballys las vegas shows
 
http://8.dynos.gotdns.com/mebj22h.html how to sell luxury real estate
 
http://5.neen.servegame.org/1p0bs9n.html liquid petroleum gas conversion
 
http://8.tests.dyndns.tv/717yp.html birthday princess party
 
http://1.mywy.homeip.net/du1i6y.html loadpicture function in
 
http://11.dynos.gotdns.com/me04iyh.html mlb08 the show official
 
http://2.hoolpy.dyn-o-saur.com/n8w9.html lake almanor real estate
 
http://7.dynos.gotdns.com/lzt18.html puppet master film
 
http://2.wifin.shacknet.nu/x9g4.html kemp town brighton uk
 
http://11.neen.servegame.org/swc3pk.html videos de amimales
 
http://9.webius.servebbs.com/202ld.html tropicana showroom atlantic city
 
http://2.jonny.dnsalias.com/61zyxmn.html gfi faxmaker sending
 
http://11.webius.servebbs.com/59wb.html why do you persecute
 
http://10.mywy.homeip.net/zhnnc92.html what not to do while pregnant
 
http://5.host.is-a-geek.org/lg2ow.html test braodband connection
 
http://2.jonny.dnsalias.com/6l2h.html windows xp home sp2 cd key
 
http://11.fortor.dvrdns.org/s582koi.html west virginia mountaineer clothing
 
http://7.hoolpy.dyn-o-saur.com/p9g6is.html holiday on king toronto
 
http://9.mywy.homeip.net/mdv7.html used mercedes benz parts
 
http://9.webius.servebbs.com/ryur9.html birthday wishes ecards
 
http://6.webius.servebbs.com/8i6y.html luton town fixtures
 
http://7.wifin.shacknet.nu/fnhjs1n.html department of motor vehicle form
 
http://2.dynos.gotdns.com/c3g6le.html chanderpaul six video
 
http://10.host.is-a-geek.org/hc7c.html stratton 12h802 parts
 
http://4.wifin.shacknet.nu/k0rt.html three days grace -i hate everything
 
http://1.webius.servebbs.com/ow5w7.html dog training careers
 
http://1.hoolpy.dyn-o-saur.com/8t8fz.html fantastic four 2 wallpaper
 
http://5.host.is-a-geek.org/ed5jx.html drug test questions
 
http://10.host.is-a-geek.org/99begm.html international caravan and motorhome show
 
http://4.fortor.dvrdns.org/736x51.html sopranos episode 34
 
http://8.jonny.dnsalias.com/sz4qh.html seattle and downtown
 
http://7.wifin.shacknet.nu/ik78.html where is brimstone
 
http://3.hoolpy.dyn-o-saur.com/5wcd2pb.html lyrics to hicktown by jason aldean
 
http://4.fortor.dvrdns.org/4snjw.html how to reach torna
 
http://9.jonny.dnsalias.com/pd5jk.html iwlwifi 3945 1 ucode
 
http://1.webius.servebbs.com/e63q.html pleasure i did you wrong video
 
http://2.jonny.dnsalias.com/ppvvikt.html sun newspaper on line
 
http://7.neen.servegame.org/z91by.html everyday alice walker
 
http://11.jonny.dnsalias.com/833s.html how to grow strawberries indoors
 
http://3.webius.servebbs.com/lptploi.html war of the worlds theme
 
http://3.hoolpy.dyn-o-saur.com/oydsju.html grandfather gifts for holiday
 
http://4.dynos.gotdns.com/oq4z.html paper hole punchers
 
http://2.jonny.dnsalias.com/2v6sx4j.html how to make fiberglass boxes
 
http://5.jonny.dnsalias.com/y93ozfn.html germanna community college home
 
http://7.fortor.dvrdns.org/34ueh.html neuropsychological assessment tests
 
http://11.host.is-a-geek.org/a6yh.html little codeck pack
 
http://5.webius.servebbs.com/399xw.html how to rebuild trust in relationships
 
http://8.mywy.homeip.net/70r8.html oakridge home furnishings
 
http://8.webius.servebbs.com/a5yvvro.html india vs south africa 3rd test day3
 
http://1.neen.servegame.org/lcyionw.html maritime academy castine maine
 
http://1.fortor.dvrdns.org/q4jt.html how to import outlook 2003
 
http://5.tests.dyndns.tv/rt63e28.html carol jo vecchie springfield
 
http://6.webius.servebbs.com/b3bh79u.html huxley and partners
 
http://5.hoolpy.dyn-o-saur.com/4n0e.html bible word search puzzle
 
http://10.jonny.dnsalias.com/60yml2.html codec to play divx
 
  
 
== '''Security''' ==
 
== '''Security''' ==

Revision as of 21:47, 30 March 2009

Configuration

What is the main configuration file for Fail2ban?

Fail2ban configuration process is rather simple. There is only one configuration file, where Fail2ban can be fully configured, this file is located at: /etc/fail2ban/fail2ban.conf

You are able to edit this file using any editor you want: vim, emacs, joe, ae...

Configuration file must be edited by root.

How can Fail2ban be configured?

This step is fully detailed at HOWTOs chapter

Can I exclude failed logins for selected users from resulting in a ban?

(I don't know, perhaps that's a feature request.)

Edit: Cause fail2ban didn't know anything of the username format logged in the specific file(s) (if usernames even get logged), it is only possible to exclude selected users in the regex of the service section.

Is there a way to have bans persist over restarts and log rotation?

Security

What do I have to consider when using Fail2ban?

Especially on systems which provide SSH/CGI/PHP services to unknown users, it is possible to block other users from ssh and probably other services. How would a user do so? The user could issue:

logger -p auth.warning -t 'sshd[123]' 'Illegal user user1 from 1.2.3.4'

Or the malicious user may write via PHP's openlog()/syslog() to syslog.

Solution #1: This security hazard can be handled via ownership/permissions of /dev/log, which allows logging to all the users by default. Just add a group log, add all daemons and root to that group and be happy.

What about log injection?

Fail2ban parses log files of other services and thus it can be vulnerable to log injection. Daniel B. Cid describes this kind of issues in Attacking Log analysis tools. I strongly suggest that you read this article. We will always try to provide safe configuration files. However, you can use fail2ban-regex to test your configuration files against forged log lines.

Troubleshooting

I have Postfix on my system but no "mail" command. How can I get e-mail notifications?

As of version 0.8.1, "mail" actions are deprecated. Please use the "sendmail" ones instead. E.g. sendmail-whois instead of mail-whois in your jail.[conf|local].

You probably have the sendmail command. Copy /etc/fail2ban/action.d/mail-whois.conf to /etc/fail2ban/action.d/mail-whois.local, edit this file and replace mail with sendmail. Here is an example:

actionban = echo -en "From:root <fail2ban>
            To: <dest>
            Subject: [Fail2Ban] <name>: banned <ip>
            Hi,\n
            The IP <ip> has just been banned by Fail2Ban after
            <failures> attempts against <name>.\n\n
            Here are more information about <ip>:\n
            `whois <ip>`\n
            Regards,\n
            Fail2Ban"|sendmail -t  

mail.conf can be modified too.

Why do my CVS users using SSH getting blocked?

If you are using the Eclipse CVS integration with SSH, then each access of the CVS results in a failed access before a valid one is done. As a consequence your CVS users get banned from time to time.

I get the error "Please check the format and your locale settings"

The error looks like this:

ERROR: time data did not match format: data=Mar 21 10:00:50 fmt=%b %d %H:%M:%S
ERROR: Please check the format and your locale settings.

This is a known bug. Since 0.6.1, Fail2ban uses your locale settings for date and time format. However, some daemons do not take care of locale and write their log messages using the POSIX standard. Please look at this bug for more details.

You can try to override the LANG variable:

# LANG=en_US /etc/init.d/fail2ban restart

You can get all the available locale with:

# locale -a

How do I increase verbosity?

In order to increase the verbosity of Fail2ban, use the command line option -vvv for fail2ban-client and fail2ban (only for 0.6.x). Set loglevel to 4 in /etc/fail2ban/fail2ban.conf (only for > 0.6.x).

Fail2ban is running but not banning SSH bruteforce

NB:This example is based on a Debian system, but can be easily done on any distro.

The package is well installed:

# dpkg -l |grep fail                                               
ii  fail2ban                      0.8.1-2                         bans IPs that 
cause multiple authentication

The service is running:

# /etc/init.d/fail2ban status                                      
Status of authentication failure monitor: fail2ban is running

SSH jail is set up and ready:

# fail2ban-client status                                           
Status                                                                          
|- Number of jail:      1                                                       
`- Jail list:           ssh

SSH bruteforce logs are identified by fail2ban:

# fail2ban-regex /var/log/auth.log /etc/fail2ban/filter.d/sshd.conf
....
Success, the total number of match is 30

So, check that all your logs are synchronized: all logs files (auth.log, syslog,..) must use the same time reference (if your server is not very busy, there will probably be an important difference between the output of [1]date command and the last event logged in syslog. You can force to generate a log in syslog using the logger command and check then with the output of date command)

# date                                                             
Wed Nov 28 13:49:02 CET 2007                                                    
# tail -2 /var/log/auth.log                                        
Nov 28 13:39:12 <SERVERNAME> sudo: pam_unix(sudo:session): session opened for user roo
t by <user>(uid=0)                                                              
Nov 28 13:39:12 <SERVERNAME> sudo: pam_unix(sudo:session): session closed for user roo
t

If time reference is not the same everywhere, then fail2ban won't ban any IP!