[SOLVED] Fail2ban showing error Unable to contact server. Is it running?
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Fail2ban showing error Unable to contact server. Is it running?
We start fail2ban in centos using this command service fail2ban start but when we run service fail2ban status we get as below? What could be the mistake ya? Fail2ban (pid 2810 2813) is running... ERROR Unable to contact server. Is it running? We installed is from the epel source.
Fail2ban (pid 2810 2813) is running... ERROR Unable to contact server. Is it running?
Is it running? What gives
Code:
ps -ef|grep fail2ban
If it's running, most likely fail2ban-client cannot find the socket created by the server. Find the socket location from the command above and edit /etc/fail2ban/fail2ban.conf to specify the correct socket location.
Dear Bathory,
Under which file should I look for clue because I tried search most of the file for fail2ban I cant find much. I have tried /var/log/message but just tells me when it was installed only.
Dear Bathory,
Under which file should I look for clue because I tried search most of the file for fail2ban I cant find much. I have tried /var/log/message but just tells me when it was installed only.
I'm not running Centos, but from what I've read you should look at /var/log/messages and /var/log/fail2ban.log for logs.
You may also try to start the server in the foreground and see if you get any errors
Dear Bathory,
I tried this fail2ban-server -f -s /var/run/fail2ban/fail2ban.sock
2012-12-31 10:51:34,239 fail2ban.server : INFO Starting Fail2ban v0.8.4 and I just stuck here. I cant find any folder /var/log/fail2ban.log and /var/log/message have no information only for the installation of fail2ban.
Dear Bathory,
I have tried based on your link you gave so looks like it is a must to do the jail.conf copy into jail.local. I did that and then restart the fail2ban all is working well now as you can see below. That mean the missing part was there but what is the reason for the copy and why jail.local is the config file any reason?
I have tried based on your link you gave so looks like it is a must to do the jail.conf copy into jail.local. I did that and then restart the fail2ban all is working well now as you can see below. That mean the missing part was there but what is the reason for the copy and why jail.local is the config file any reason?
It's not mandatory to copy jail.conf to jail.local. You do this because during an upgrade it's possible that the conf file gets overwritten, so you loose your custom settings.
Other than that, I don't see any reason why fail2ban was not starting at first. Maybe you had an error in the original jail.conf that you fixed after editing jail.local.
Anyway, I'm glad it worked. You may mark the thread "Solved" fro the "Thread tools" on top of the page.
Dear Bathory,
No I did not change anything to the copy at all. IS just the original version as it is? Now I am curious I am going to set another machine I think I must do the copy first? But where is the link saying to pick the configuration from jail.copy rather than jail.conf maybe this the one stopping it?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.