Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
After many years working in a Windows environment I have been moved into a different position at my job working on Unix/Linux systems. We had a c omplaint of hack attempts via ssh to some servers recently. I confirmed the IPS in the log files and compared to what was listed in hosts.deny.
Hosts.deny is setup to deny ssh sessions from all IPs except for a select few. Hosts.allow is empty. Can someone tell me why these rogue IP's are allowed connectivity if they are not on the allow list?? Any help would be much appreciated. Thanks.
I suggest not relying on one line of defense. Since this is really about SSH attempts best read the solutions listed in the Linux Security sticky thread "Failed SSH login attempts" and pick a solution appropriate for your situation.
Here's an excerpt from that may shed a light on what's happening:
Quote:
Originally Posted by ^H^H^H from man 5 hosts_access
. Access will be granted when a (daemon,client) pair matches an
entry in the /etc/hosts.allow file.
. Otherwise, access will be denied when a (daemon,client) pair
matches an entry in the /etc/hosts.deny file.
. Otherwise, access will be granted.
Basically you will want to drop everything from hosts.deny (ALL: ALL) and set up exceptions in hosts.allow.
Just wondering how this is different? Will the person trying to ssh into the server get dropped immediately or will they get same message as if it was the other way around?
You can see the 2nd line of my ldd output lists "libwrap.so.0", so mine is compiled with the required tcp_wrappers support. Most distros are compiled with this support in sshd, but it wouldn't hurt to check - just to make sure. Without such compiled in support, sshd will ignore your hosts.allow or hosts.deny files.
Is there anything in your /var/log/auth.log file that might give you some clue? (file location may be different for your distro) I wouldn't expect much to be there, but check anyway.
Somebody might be able to spot something amiss if you cut/paste the contents of the following files:
When you installed TCP wrappers, you should have kept the tcpd.h and libwrap.a files. Usually tcpd.h goes in /usr/local/include and libwrap.a goes in /usr/local/lib. By default, installing TCP wrappers doesn't install these two files, so you may need to grab the TCP wrappers source and recompile it, then install those two files.
This info came from this site (chapter 5.9): ssh faq 5
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.